Examples of adding tools dynamically based on methods from another class #669
Unanswered
yashgoswami
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Question Category
Your Question
I have been following the SDK and examples and could create an MCP server based on a class (say MyMcpTools) having methods decorated with MCPServerTool attribute having description and names and then using .WithTools.
However, now I want to conditionally add tools from methods from a generic class which as injected Dependencies. And add tool description, name etc. dynamically (I will fetch them from config for example).
I tried using overloaded methods of McpServerTool.Create() but either it doesn't add McpServerToolCreateOptions to the tool or client not able to run the tool. Are there any clear examples that I can refer to achieve this.
Beta Was this translation helpful? Give feedback.
All reactions