0Pricing
MCP Academy · Lesson

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

  1. Name & Describe a Tool Well
  2. Declare Parameters with Type Hints
  3. Return Useful Results
  4. A Calculator Tool, Start to Finish
← Back to MCP Academy