Declare Parameters with Type Hints
Use Python hints to shape the tool schema.
Parameters Become a Schema
Every argument of your tool function turns into part of an input schema the model must follow when it calls your tool. 🧩
Type Hints Do the Work
FastMCP reads your Python type hints and builds the JSON schema for you, so you rarely write schema by hand.
@mcp.tool()
def add(a: int, b: int) -> int:
return a + bAll lessons in this course
- Name & Describe a Tool Well
- Declare Parameters with Type Hints
- Return Useful Results
- A Calculator Tool, Start to Finish