Understanding Resources
Resources are:- Discoverable: Clients can list and browse available resources
- Readable: Content can be retrieved via URI
- Typed: Each resource has a MIME type
- Annotated: Metadata helps clients understand resource purpose
Resources
Fixed content that doesn’t change based on parameters. Use response helpers for cleaner code:Resource Templates
Resources with parameterized URIs for dynamic content:Resource Annotations
Provide metadata to help clients use resources effectively:Multiple Content Items
Resources can return multiple content items:Callback Signature Variations
Resource templates support multiple callback signatures. Use the simplest one that meets your needs:Notifying Clients of Resource Changes
When dynamically adding or removing resources, notify clients to refresh their resources cache:Testing
- Start server with inspector
- Navigate to Resources tab
- Browse available resources
- Click to read resource content
- Verify content and MIME type
Next Steps
- Response Helpers - Utility functions for creating responses
- Tools Guide - Building executable tools
- UI Widgets - Creating interactive UI components
- Examples - Real-world resource implementations