-
Notifications
You must be signed in to change notification settings - Fork 816
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
This might be a follow-up to #480. I noticed that initially the inspector correctly omits values in the request that are optional and not filled out. However, when I change the value to something and then remove the value again (so I have an empty textfield), the inspector sends ""
instead of not sending the value at all.
To Reproduce
Steps to reproduce the behavior (simplified):
- Using the Go SDK, I have the following argument definition:
Price uint32 `json:"price,omitempty" jsonschema:"Some description"`
- When running
List Tools
, I get the expected result:
{
"tools": [
{
"name": "search",
"description": "Something",
"inputSchema": {
"type": "object",
"properties": {
"price": {
"type": "integer",
"description": "Some description"
}
},
"required": [],
"additionalProperties": {
"not": {}
}
},
}
]
}
- Invoking the tool, I see the correct request not containing the argument:
{
"method": "tools/call",
"params": {
"name": "search",
"arguments": {},
"_meta": {
"progressToken": 0
}
}
}
- Afterwards I write
0
in the price field and delete it again. If I now run the tool again, an empty string is sent for the integer price field.
{
"method": "tools/call",
"params": {
"name": "search",
"arguments": {
"price": "",
},
"_meta": {
"progressToken": 1
}
}
}
Expected behavior
If I enter anything for an optional field and delete the value again, it should not be sent in the request (like initially).
Additional context
I tested both v0.16.1 and the latest commit from this repository. Both have the issue.
aeriksson
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working