-
Notifications
You must be signed in to change notification settings - Fork 166
fix: remove invalid 'optional' keyword from exec_in_pod schema #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The exec_in_pod tool schema was using 'optional: true' which is not a valid JSON Schema property, causing "strict mode: unknown keyword" errors when starting the MCP server. In JSON Schema, optional properties are indicated by simply not including them in the 'required' array, not by using an 'optional' keyword. Changes: - Remove 'optional: true' from container, shell, and timeout properties - Update corresponding test assertions - Maintain same functionality (parameters remain optional) Fixes Docker container startup error: "Invalid schema for tool exec_in_pod: strict mode: unknown keyword: \"optional\""
}, | ||
timeout: { | ||
type: "number", | ||
description: "Timeout for command - 60000 milliseconds if not specified", | ||
optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have some default value ? because we want timeout to be optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be you willing to remove only ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rr-paras-patel the way I understood it, and I could be wrong, was that because it's optional it doesn't have to be defined here.
This PR really is just about making sure the MCP starts up in VSCode w/ Augment without giving errors such as:
Failed to start the MCP server. {"command":"docker run -e HTTPS_PROXY=http://host.docker.internal:3128 -e NO_PROXY=127.0.0.1,localhost -i --rm -v ~/.kube/config:/home/appuser/.kube/config mcp/k8s","args":[],"error":"Invalid schema for tool exec_in_pod: strict mode: unknown keyword: \"optional\"","stderr":"Starting Kubernetes MCP server v0.1.0, handling commands...\n"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct - must have missed it in #155 where the other optional properties were removed. Also, the timeout uses a default value on line 119 already:
const timeoutMs = input.timeout || 60000;
}, | ||
timeout: { | ||
type: "number", | ||
description: "Timeout for command - 60000 milliseconds if not specified", | ||
optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be you willing to remove only ,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
}, | ||
timeout: { | ||
type: "number", | ||
description: "Timeout for command - 60000 milliseconds if not specified", | ||
optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks correct - must have missed it in #155 where the other optional properties were removed. Also, the timeout uses a default value on line 119 already:
const timeoutMs = input.timeout || 60000;
Going to merge this in to get into next release. Thanks @anthonysr! |
The exec_in_pod tool schema was using 'optional: true' which is not a valid JSON Schema property, causing "strict mode: unknown keyword" errors when starting the MCP server.
In JSON Schema, optional properties are indicated by simply not including them in the 'required' array, not by using an 'optional' keyword.
Changes:
Fixes Docker container startup error:
"Invalid schema for tool exec_in_pod: strict mode: unknown keyword: "optional""