mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
Fix documentation to use 'meta' instead of '_meta' for MCP spec field (#2735)
This commit is contained in:
parent
9f5a177126
commit
4de06d7f73
7 changed files with 24 additions and 24 deletions
|
|
@ -324,7 +324,7 @@ mcp = FastMCP.from_openapi(
|
|||
|
||||
#### OpenAPI Tags in Client Meta
|
||||
|
||||
FastMCP automatically includes OpenAPI tags from your specification in the component's metadata. These tags are available to MCP clients through the `_meta._fastmcp.tags` field, allowing clients to filter and organize components based on the original OpenAPI tagging:
|
||||
FastMCP automatically includes OpenAPI tags from your specification in the component's metadata. These tags are available to MCP clients through the `meta._fastmcp.tags` field, allowing clients to filter and organize components based on the original OpenAPI tagging:
|
||||
|
||||
<CodeGroup>
|
||||
```json {5} OpenAPI spec with tags
|
||||
|
|
@ -344,9 +344,9 @@ FastMCP automatically includes OpenAPI tags from your specification in the compo
|
|||
async with client:
|
||||
tools = await client.list_tools()
|
||||
for tool in tools:
|
||||
if hasattr(tool, '_meta') and tool._meta:
|
||||
if tool.meta:
|
||||
# OpenAPI tags are now available in _fastmcp namespace!
|
||||
fastmcp_meta = tool._meta.get('_fastmcp', {})
|
||||
fastmcp_meta = tool.meta.get('_fastmcp', {})
|
||||
openapi_tags = fastmcp_meta.get('tags', [])
|
||||
if 'users' in openapi_tags:
|
||||
print(f"Found user-related tool: {tool.name}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue