modelcontextprotocol / modelcontextprotocol/typescript-sdk
Feature: Retrieve info about registered Resources and execute them from a tool
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
Problem
I think it would be interesting to be able to create tools that can see what resources have been registered and return their content or process it to improve the model context.
Solution
Server should have a method that returns an array with the metadata of the registered resources, as well as a method to execute them by name and/or uri and obtain their content.
Additional context
Make it easier for models to get their own context through tools, or obtain resource context to use with sampling in tools.
Workaround
let regResources = [];
let newResource = server.registerResource( ... );
regResources.push({resource: newResource, resUri: uri});
...
let resourceToCall = regResources.find(res => res.resource.name === resourceNameToCall);
let resourceContent = await resourceToCall.readCallback(URL(resourceToCall.resUri), extra);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the server's existing registerResource API, including its resource metadata and read callback behavior. Clarify how registered resources should be listed and how execution by name or URI should return content, then define coverage for both lookup forms. Done means the server exposes the requested metadata and resource content behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100