Skip to main content
Glama

FastAPI-MCP

by tadata-org
tool-naming.mdx956 B
--- title: Tool Naming icon: input-text --- FastAPI-MCP uses the `operation_id` from your FastAPI routes as the MCP tool names. When you don't specify an `operation_id`, FastAPI auto-generates one, but these can be cryptic. Compare these two endpoint definitions: ```python {2, 7} # Auto-generated operation_id (something like "read_user_users__user_id__get") @app.get("/users/{user_id}") async def read_user(user_id: int): return {"user_id": user_id} # Explicit operation_id (tool will be named "get_user_info") @app.get("/users/{user_id}", operation_id="get_user_info") async def read_user(user_id: int): return {"user_id": user_id} ``` For clearer, more intuitive tool names, we recommend adding explicit `operation_id` parameters to your FastAPI route definitions. To find out more, read FastAPI's official docs about [advanced config of path operations.](https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tadata-org/fastapi_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server