-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed as duplicate of#1402
Labels
questionFurther information is requestedFurther information is requested
Description
Question
I was creating a mcp server that has tools which has multiple params, in which most are optional, how do I represent this
Currently what I was doing is
param1: Optional[str] = Field(default=None, description="desc of param"),
param2: Optional[str] = Field(default=None, description="desc of param 2")
The way it appears in inspector is:
"param1": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "desc of param",
"title": "param1"
},
"param2": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "desc of param 2",
"title": "param2"
}
Is this the right expectation with the anyOf block, or should that not exist?
Additional Context
No response
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested