Add title to tools, resources, prompts by felixweinberger · Pull Request #972 · modelcontextprotocol/python-sdk
Add optional title field to core MCP types: - Tool: For human-readable tool display names - Resource: For human-readable resource display names - ResourceTemplate: For human-readable template display names - Prompt: For human-readable prompt display names - Implementation: For human-readable implementation display names The title field provides a way to display user-friendly names in UIs while keeping programmatic names stable. All fields are optional to maintain backwards compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add BaseMetadata base class to provide common name and title fields for consistency with TypeScript SDK implementation. This centralizes the field definitions for Implementation, Tool, Resource, ResourceTemplate, and Prompt classes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add optional title field to tools, resources, prompts, and resource templates in FastMCP to enable human-readable display names. Also includes a utility function get_display_name() for consistent title/name precedence handling. - Add title parameter to @tool, @resource, and @prompt decorators - Add title field to Tool, Resource, Prompt, and ResourceTemplate models - Implement get_display_name() utility with proper precedence rules - Add comprehensive tests for title functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Update README and example servers to demonstrate the new title field feature for better human-readable display names. - Add title parameter to decorator examples in README - Update simple-tool example with "Website Fetcher" title - Update simple-resource example with resource-specific titles - Update simple-prompt example with "Simple Assistant Prompt" title 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update simple-chatbot example to show title as separate field for LLM - Add "Client Display Utilities" section to README with usage examples - Enhance get_display_name() documentation to clarify client-side usage This demonstrates best practices for displaying human-readable titles in MCP clients while maintaining programmatic names for tool execution. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
ihrpr previously approved these changes Jun 17, 2025
ihrpr previously approved these changes Jun 17, 2025
- Add titles to all tools, resources, and prompts in make_everything_fastmcp test fixture - Refactor simple-resource server to use single dict for resource data and titles - Add MCP specification link to metadata_utils.py documentation - Add comprehensive test_title_precedence to verify title functionality - Fix missing title field in test_tool_manager.py Tool instantiation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters