MCP · Lesson 117 of 120
Common Mistakes
And fixes.
Let's finish the cheat sheets with the mistakes almost everyone makes once. Avoid these, and you'll save hours.

- Everyone makes them
- Avoid them
- Save hours
Mistakes and fixes
Printing to standard output breaks standard IO servers. Vague descriptions confuse the model. Relative paths fail in host configs. Trusting arguments invites attacks. And raising plain exceptions hides the real error from the model.
| Mistake | Fix |
|---|---|
| print() in a stdio server | log to stderr |
| Vague descriptions | clear docstrings |
| Relative paths in configs | full paths |
| Trusting arguments | validate everything |
| Plain exceptions | raise ToolError |
Before and after
A vague tool called get, with a one word description, leaves the model guessing. A tool called order status, with a clear description and a typed order number, tells it exactly what to do.
Before
- def get(x)"Gets data."No types
After
- def order_status(order_id: int)"Look up a Northwind order."Typed, validated
Summary
Log to standard error, describe tools clearly, use full paths, validate, and raise tool errors. Next, the MCP ecosystem.
Key takeaways- stderr
- Clear docstrings
- ToolError
Next up: The MCP Ecosystem — popular servers