06. Tools in MCP

Chapter 6 of 22 · 20 min
EXERCISE

Implement a tool server with three tools: (1) get_weather taking a city parameter, (2) send_email taking to, subject, and body parameters, (3) calculate taking two numbers and an operation ("add", "subtract", "multiply", "divide"). Return appropriate error messages for invalid inputs.