McpWorkbench.list_tools() drops MCP tool annotations; ToolSchema has no annotations field (0.7.2) #6929
mesimewplc
started this conversation in
Feature suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
Annotations are part of many MCP tool ecosystems and are useful for UI/UX hints (e.g., readOnly, destructive) - documented here: MCP Annotations Spec (2025-06-18). As of Autogen 0.7.2 there is still no official support for annotations.
Stock
McpWorkbench.list_tools()
does not surface MCP tool annotations even when the server provides them, while raw MCPlist_tools
shows annotations present for tools.Root cause:
autogen_core.tools._base.ToolSchema
lacks annotations;autogen_ext.tools.mcp._workbench.McpWorkbench.list_tools()
doesn’t forward them.Sample script to reproduce:
Example output observed:
Expected: If MCP server returns annotations,
McpWorkbench.list_tools()
should preserve them in the returned tool schema.Actual:
stock_workbench.has_annotations
is false whileraw_mcp.has_annotations
is true. Annotations are dropped during conversion.Origin:
autogen_core.tools._base.ToolSchema
does not include an annotations key:And
autogen_ext.tools.mcp._workbench.McpWorkbench.list_tools()
maps MCP tool responses into ToolSchema without forwarding annotations:Suggested Fix:
Add annotations:
NotRequired[Dict[str, Any]]
toautogen_core.tools._base.ToolSchema
.In
autogen_ext.tools.mcp._workbench.McpWorkbench.list_tools()
, iftool.annotations
exists, include it when constructing the ToolSchema result.For example:
ToolSchema(..., annotations=getattr(tool, "annotations", None) or None)
Beta Was this translation helpful? Give feedback.
All reactions