You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to use prompts and resources in MCP servers? Can prompts and resources be reused or called from tools? #481
I'm building an MCP server using @modelcontextprotocol/sdk with TypeScript and integrating it into an app like VSCode. From what I see, only tools are recognized and used by the app/client, while resources like prompt are not.
I'm trying to understand:
How are prompt resources meant to be used in an MCP server?
Can a prompt be invoked from within a tool? (e.g., a tool that internally calls a prompt and returns its result)
What's the recommended pattern for reusing prompts across tools or other resources?
In environments like VSCode, is there any support for exposing non-tool resources (like prompts or resources) or linking prompts and tools in some way?
Some documentation or example code would be really helpful to clarify how prompts and other resources should be structured and composed with tools.
changed the title [-]How to use prompt and other resource types in MCP servers? Can prompts be reused or called from tools?[/-][+]How to use prompts and resources in MCP servers? Can prompts and resources be reused or called from tools?[/+]on May 12, 2025
Vscode now supports both prompts and resources in agent mode. To access prompts exposed by a server you can use the "/" for quickly accessing the prompts. Clicking on "Add Context" button will allow you to select a Resource and insert it into the context window of the Agent.
Would be interested in knowing whether a tool can access the servers prompts and resources. I don't think it should be an issue since primitives like the root were created to be consumed by the server itself.
Vscode now supports both prompts and resources in agent mode. To access prompts exposed by a server you can use the "/" for quickly accessing the prompts. Clicking on "Add Context" button will allow you to select a Resource and insert it into the context window of the Agent.
Would be interested in knowing whether a tool can access the servers prompts and resources. I don't think it should be an issue since primitives like the root were created to be consumed by the server itself.
omg your statement makes sense for me now!!! I was thinking what the f is the difference between a resource and a tool and why vs code co pilot seem not to use resources. For me, implementing resources made more sense since my mcp server should expose documentation information, but only exposed as tools they were used by copilot, which is weird because you can really nicely declare resources with the sdk. Also apparently according to the sdk a tool can return an array of resource links, but those were never used. In generel I found, that only the first object of that array was used, regardless of the object type. Idk really, this stuff seems really powerful but really buggy and undocumented
Activity
[-]How to use prompt and other resource types in MCP servers? Can prompts be reused or called from tools?[/-][+]How to use prompts and resources in MCP servers? Can prompts and resources be reused or called from tools?[/+]KingfinnX commentedon May 17, 2025
same question
hasani114 commentedon Jun 13, 2025
Vscode now supports both prompts and resources in agent mode. To access prompts exposed by a server you can use the "/" for quickly accessing the prompts. Clicking on "Add Context" button will allow you to select a Resource and insert it into the context window of the Agent.
Would be interested in knowing whether a tool can access the servers prompts and resources. I don't think it should be an issue since primitives like the root were created to be consumed by the server itself.
RobbyRabbitman commentedon Jul 11, 2025
omg your statement makes sense for me now!!! I was thinking what the f is the difference between a resource and a tool and why vs code co pilot seem not to use resources. For me, implementing resources made more sense since my mcp server should expose documentation information, but only exposed as tools they were used by copilot, which is weird because you can really nicely declare resources with the sdk. Also apparently according to the sdk a tool can return an array of resource links, but those were never used. In generel I found, that only the first object of that array was used, regardless of the object type. Idk really, this stuff seems really powerful but really buggy and undocumented