A Calculator Tool, Start to Finish
Build a small but complete arithmetic tool.
Build One Complete Tool
Let's combine everything into one small calculator tool, from a clear name to a clean result the model can trust. 🧮
Start with the Server
First create a FastMCP instance to hold the tool. Give it a name so clients can identify your server.
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("calculator")All lessons in this course
- Name & Describe a Tool Well
- Declare Parameters with Type Hints
- Return Useful Results
- A Calculator Tool, Start to Finish