How to make specific parameter be optional? #341
Unanswered
KichangKim
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This looks like a bug. You should be able to have optional array parameters as in the first example. However, in the second example As a side note, I would have caution against having too complex tool surfaces. Some models, especially smaller ones, can get confused by complex signatures and especially array of objects. Sometimes you do need a complex signature, but it's worth noting that models aren't provided with any special support to ensure they get the parameters right. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Pre-submission Checklist
Question Category
Your Question
Hi. I tried to implement MCP server tools which has optional parameters. Here is my current implemention (simplified):
With both ToolMethod1 and ToolMethod2, when LLM calls these method without setting
parameter3Optional
, an error like "required argument is invalid (parameter3Optional)" is returned. Only works when LLM set "[]" (empty array) forparameter3Optional
. How to make specific parameter be optional?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions