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.
This commit is contained in:
YueGuobin 2026-06-16 12:08:07 +08:00
parent a126f910d4
commit ec58bea24b
No known key found for this signature in database

View File

@ -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})