Add MCP tool annotations to smart_home example#2777
Conversation
Adds ToolAnnotations to all 11 tools in the smart_home example to demonstrate proper annotation usage for AI assistants: lights/server.py (10 tools): - Read-only tools (readOnlyHint=True): read_all_lights, list_groups, list_scenes, list_lights_by_group - Write tools (readOnlyHint=False): toggle_light, set_brightness, activate_scene, set_light_attributes, set_group_attributes hub.py (1 tool): - hub_status (readOnlyHint=True) All tools communicate with external Hue Bridge API (openWorldHint=True). This provides an educational example for FastMCP users on how to properly annotate their tools to help AI assistants understand tool capabilities. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
WalkthroughThe pull request adds Tool Annotations to decorator definitions in the smart home example application. Specifically, Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-12-25T15:53:07.646ZApplied to files:
🧬 Code graph analysis (2)examples/smart_home/src/smart_home/hub.py (1)
examples/smart_home/src/smart_home/lights/server.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds
ToolAnnotationsto all 11 tools in the smart_home example to demonstrate proper annotation usage for AI assistants.Changes
lights/server.py (10 tools):
readOnlyHint=True):read_all_lights,list_groups,list_scenes,list_lights_by_groupreadOnlyHint=False):toggle_light,set_brightness,activate_scene,set_light_attributes,set_group_attributeshub.py (1 tool):
hub_status(readOnlyHint=True)All tools communicate with the external Hue Bridge API, so all have
openWorldHint=True.Why This Matters
MCP Tool Annotations help AI assistants understand:
This example provides educational documentation for FastMCP users on how to properly annotate their tools.
Testing
🤖 Generated with Claude Code