Passing client context to tools
(This may be related to https://github.com/modelcontextprotocol/python-sdk/issues/373)
I would like to be able to pass some "out of band" context to a tool in an MCP server. This would be separate from the arguments that are extracted by the LLM and provided to the tool function.
How do I pass this "extra" data to the tool?
Thank you for any help.
(This may be related to #373)
I would like to be able to pass some "out of band" context to a tool in an MCP server. This would be separate from the arguments that are extracted by the LLM and provided to the tool function.
How do I pass this "extra" data to the tool?
Thank you for any help.
I ran into the same issue. Instead of struggling to figure it out, I ended up writing my own MCP from scratch — it was much faster and way more optimized.
(This may be related to #373)
I would like to be able to pass some "out of band" context to a tool in an MCP server. This would be separate from the arguments that are extracted by the LLM and provided to the tool function.
How do I pass this "extra" data to the tool?
Thank you for any help.
I also had this problem because my app needs to add user data to the tool
Can one of the contributors / maintainers comment, please?
Perhaps there is a way to do this, that I haven't discovered?
Thank you.
I've opened a PR to hopefully solve this issue https://github.com/modelcontextprotocol/python-sdk/pull/574
@martina-zxy PR was closed but its not clear to me how to provide a tool an argument which has not been generated by the language model in the request to the tool. The answer from the bot was to use the context object - but afaict there's no way to get content from the request into the context object.
Now tracked in #2098.