-
Notifications
You must be signed in to change notification settings - Fork 145
Use standard JSON Schema format for VMCP composite tool parameters #2651
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
base: main
Are you sure you want to change the base?
Conversation
3b5b3da to
b88bc23
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2651 +/- ##
==========================================
+ Coverage 55.21% 55.28% +0.07%
==========================================
Files 315 315
Lines 30123 30110 -13
==========================================
+ Hits 16632 16647 +15
+ Misses 12047 12011 -36
- Partials 1444 1452 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| ```console | ||
| helm uninstall <release_name> | ||
| ``` | ||
|
|
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.
It's not expected this file go mangled is it?
| description: "Deploy PR with user confirmation and notification" | ||
| parameters: | ||
| pr_number: {type: "integer"} | ||
| type: object |
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.
hah, this is probably tripping CI..good on you to change the proposal retroactively. We might need to override CI this time
| if crdTool.Parameters != nil && len(crdTool.Parameters.Raw) > 0 { | ||
| var params map[string]any | ||
| if err := json.Unmarshal(crdTool.Parameters.Raw, ¶ms); err == nil { | ||
| tool.Parameters = params |
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.
Is it expected the error is ignored?
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.
related: we should probably have a unit test for this
jhrozek
left a comment
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.
Looking good! I added some nits. Only because I was reviewing the docs earlier this week do I know that we in fact have docs (docs/operator/advanced-workflow-patterns.md and docs/operator/virtualmcpcompositetooldefinition-guide.md) that @tgrunnagle wrote, thos should probably be updated as well
Fixes #2650 Changes composite tool parameter definitions to use standard JSON Schema format per the MCP specification, instead of a non-standard simplified format. **Breaking Change**: Composite tool parameter format has changed from: ```yaml parameters: param1: type: "string" default: "value" ``` To standard JSON Schema: ```yaml parameters: type: object properties: param1: type: string default: "value" required: ["param1"] ``` Changes: - Update CompositeToolConfig.Parameters to map[string]any (full JSON Schema) - Remove parameter transformation logic from yaml_loader and workflow_converter - Add JSON Schema validation in yaml_loader (checks type: object) - Update Kubernetes CRDs to use runtime.RawExtension for parameters - Update webhook validation to handle runtime.RawExtension - Regenerate CRD manifests and deepcopy code - Update all tests and documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
- Fix operator-crds README.md that was accidentally emptied - Add comprehensive unit tests for composite tool parameter conversion - Improve error handling documentation in converter.go - Bump toolhive-operator Helm chart version from 0.5.2 to 0.5.3 - Update all documentation to use standard JSON Schema format for parameters 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
b88bc23 to
95d49b8
Compare
tgrunnagle
left a comment
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.
Couple of questions but non-blocking
| // }, | ||
| // "required": ["param2"] | ||
| // } | ||
| Parameters map[string]any `json:"parameters,omitempty"` |
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.
Is it possible to have strong typing with something like
...
Parameters map[string]ParameterEntry `json:"parameters,omitempty"`
...
type ParameterEntry struct {
Type string `json:type`
Description string `json:description`
Properties map[string]ParameterEntry `json:properties,omitempty` // optional, used with type == object
| } | ||
|
|
||
| // Type should be "object" for parameter schemas | ||
| if typeStr != "object" { |
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.
My understanding is that we want to support non-object top level parameters? Maybe I'm confused https://stacklok.slack.com/archives/C09L9QF47EU/p1763562651723149?thread_ts=1763507520.825579&cid=C09L9QF47EU
Fixes #2650
Summary
Changes composite tool parameter definitions to use standard JSON Schema format per the MCP specification, instead of a non-standard simplified format.
Breaking Change
Composite tool parameter format has changed from:
To standard JSON Schema:
Changes
CompositeToolConfig.Parameterstomap[string]any(full JSON Schema)runtime.RawExtensionfor parametersruntime.RawExtensionTest plan
🤖 Generated with Claude Code