From ec58bea24bfaef9a899f6afe0c6708501a8727fe Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Tue, 16 Jun 2026 12:08:07 +0800 Subject: [PATCH] Fix template_list return type annotation to match _run_handler_sync envelope template_list was annotated as dict[str, Any] but _run_handler_sync always returns a list envelope ([{"type":"text",...}]). Other tools use list[dict[str, Any]] consistently. This caused a Pydantic dict_type validation error on the client. --- gns3server/api/routes/mcp/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/api/routes/mcp/__init__.py b/gns3server/api/routes/mcp/__init__.py index 8d9285c82..9e0935ae6 100644 --- a/gns3server/api/routes/mcp/__init__.py +++ b/gns3server/api/routes/mcp/__init__.py @@ -675,7 +675,7 @@ async def template_list( fields: Annotated[list[str] | None, Field(description="Response fields to include (default: [template_id, name, template_type, category, default_name_format]). " "Available: template_id, name, version, category, default_name_format, symbol, " "template_type, compute_id, usage, tags, builtin, created_at, updated_at")] = None, -) -> dict[str, Any]: +) -> list[dict[str, Any]]: """List all available templates on the server.""" return await asyncio.to_thread(_run_handler_sync, list_templates_handler, {"fields": fields})