Replies: 4 comments 31 replies
-
I like the alternative options more than the current generics and reflection approach. When I looked at the interface, I was quite confused about what I would get from the reflection and what I guess the reflection won't set function parameter names, so I may need to add function parameter names through additional input? I also want to constrain the minimum and maximum values for some function parameters, but how can I configure this using the Besides, I want to specify the property ordering because some properties have dependencies on each other, and I want the model to generate the parent parameter value first. Stepping back, if you do nothing and just exposed a simple struct rather than the
The current design has a learning curve. I am still struggling to translate this to |
Beta Was this translation helpful? Give feedback.
-
Question: what other features of JSON Schema do you use? @qiaodev You said, "I also want to constrain the minimum and maximum values for some function parameters." Is that a common thing? The "null hypothesis" is that only the property types, description and required bit are used. |
Beta Was this translation helpful? Give feedback.
-
Alternative API for adding tools: #73. |
Beta Was this translation helpful? Give feedback.
-
Descriptions for parameters in field tags works great in the majority of cases, imo. This works, in part, because you can use the tool’s overall description to refine the LLM’s understanding rather than making the field tags unruly. So the field tags' description and the tool description work in concert. Calling it "mcp" is a little confusing, I wonder if we might just go with "description" or "desc." We do need the escape hatch as discussed above but I have no opinion on #57 atm. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Your Idea
Tool binding is one of the most nuanced areas of the MCP SDK design. The design doc has a survey of options. I'm opening this discussion to collect feedback and share ideas.
See that doc for details, but to summarize: we considered a spectrum of binding APIs, and settled for a middle ground that uses a combination of generics and reflection to handle automatic marshaling of input and validation of input schemas (and eventual output, once we add support for output schema), along with options to modify the schema, which are primarily used to set descriptions.
Additionally, users can always create a tool 'manually' by constructing a
ServerTool
literal with a non-genericToolHandler
.However, there are a few potential problems with these APIs that could warrant changes:
NewServerTool
(andServerTool
) could be improved: isn't a 'ServerTool' just a 'Tool'?Alternatives
We are considering several alternatives / extensions to the APIs above.
mcp
struct tag to allow specifying property descriptions in the tool parameter struct. The downside of this is that descriptions are limited in their verbosity, and static.//mcp:description ...
comments to read the description from the doc string. This requires an extra step, and still has the same problem that descriptions are static.ToolOptions
, to simplifymcp.Input(mcp.Property("p", mcp.Description("the description")))
. For example the above could be shortned tomcp.Describe("p", "the description")
.After using them a bit, what do folks think about these APIs? Can/should they be improved?
CC @jba @hyangah @SamMorrowDrums
Scope
Beta Was this translation helpful? Give feedback.
All reactions