fix: add missing items to DebuggerGetVariables array schema (#24)#25
Open
marianfoo wants to merge 1 commit intooisee:mainfrom
Open
fix: add missing items to DebuggerGetVariables array schema (#24)#25marianfoo wants to merge 1 commit intooisee:mainfrom
items to DebuggerGetVariables array schema (#24)#25marianfoo wants to merge 1 commit intooisee:mainfrom
Conversation
The `variable_ids` parameter on `DebuggerGetVariables` was declared as
a JSON Schema `array` type without the required `items` property. Per
the JSON Schema specification, `array` types must include `items` to
describe the element type.
This caused OpenAI (and any strict JSON Schema validator) to reject the
entire MCP tool set with a 400 error, breaking all tools — not just the
debugger.
Add `mcp.Items(map[string]interface{}{"type": "string"})` to match the
pattern already used by all other array parameters in the codebase
(GrepObjects, GrepPackages).
Fixes oisee#24
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing
mcp.Items(map[string]interface{}{"type": "string"})to thevariable_idsarray parameter on theDebuggerGetVariablestool registration.This is a one-line fix for #24.
Problem
The
DebuggerGetVariablestool declaresvariable_idsas a JSON Schemaarraybut omits the requireditemsproperty. This produces invalid JSON Schema:{ "variable_ids": { "type": "array", "description": "Variable IDs to retrieve ..." } }Per the JSON Schema specification, an
arraytype must includeitemsto describe the element type. Without it, OpenAI and any strict JSON Schema validator reject the entire tool set with a 400 error — breaking all tools, not just the debugger.Fix
mcp.WithArray("variable_ids", mcp.Description("Variable IDs to retrieve (e.g., ['@ROOT'] for top-level, or specific IDs like ['LV_COUNT', 'LS_DATA'])"), + mcp.Items(map[string]interface{}{"type": "string"}), ),This matches the pattern already used by all other array parameters in the codebase (
GrepObjects.object_urls,GrepPackages.packages,GrepPackages.object_typesinhandlers_codeintel.go).Audit
I audited all
WithArraycalls in the codebase. Results:Items?internal/mcp/server.goDebuggerGetVariables.variable_idsinternal/mcp/handlers_codeintel.goGrepObjects.object_urlsinternal/mcp/handlers_codeintel.goGrepPackages.packagesinternal/mcp/handlers_codeintel.goGrepPackages.object_typesDebuggerGetVariableswas the only affected tool.Verification
go build ./...— compiles cleanlygo test ./...— all unit tests pass (includinginternal/mcppackage tests)Disclosure
This fix was identified, implemented, and audited with the assistance of an AI (Claude). The root-cause analysis from #24 was used as the starting point. The AI verified the fix compiles and passes all existing tests, and audited the full codebase for similar issues.
Fixes #24
Made with Cursor