Use this file to discover all available pages before exploring further.
Tools are the functions your MCP server exposes to AI assistants. When an LLM decides it needs to perform an action—like searching documents, creating issues, or fetching data—it calls one of your tools.You can use FastMCP (recommended) or the low-level Server API. Both are fully supported.
Here’s a simple tool that searches documents. Notice the type annotations and docstring—these are essential for LLMs to understand and use your tool correctly.
LLMs use docstrings to decide when to call your tool. Be specific:
# Good@mcp.tool()def create_issue(title: str, body: str) -> Issue: """Create a new issue in the project tracker. Use this when the user wants to report a bug or request a feature. """# Bad - too vague@mcp.tool()def create_issue(title: str, body: str) -> Issue: """Create an issue."""
# Bad - hides errors from observabilitytry: result = do_thing()except Exception: return "Error occurred"# Good - let errors propagateresult = do_thing() # Gumstack logs the error
FastMCP handles most use cases, but if you need fine-grained control over tool registration and responses, you can use the low-level Server class directly: