Skip to content

Comments

fix: add missing items to DebuggerGetVariables array schema (#24)#25

Open
marianfoo wants to merge 1 commit intooisee:mainfrom
marianfoo:fix/debugger-get-variables-array-schema
Open

fix: add missing items to DebuggerGetVariables array schema (#24)#25
marianfoo wants to merge 1 commit intooisee:mainfrom
marianfoo:fix/debugger-get-variables-array-schema

Conversation

@marianfoo
Copy link

@marianfoo marianfoo commented Feb 12, 2026

Summary

Adds the missing mcp.Items(map[string]interface{}{"type": "string"}) to the variable_ids array parameter on the DebuggerGetVariables tool registration.

This is a one-line fix for #24.

Problem

The DebuggerGetVariables tool declares variable_ids as a JSON Schema array but omits the required items property. This produces invalid JSON Schema:

{
  "variable_ids": {
    "type": "array",
    "description": "Variable IDs to retrieve ..."
  }
}

Per the JSON Schema specification, an array type must include items to 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_types in handlers_codeintel.go).

Audit

I audited all WithArray calls in the codebase. Results:

File Parameter Has Items?
internal/mcp/server.go DebuggerGetVariables.variable_ids no (fixed in this PR)
internal/mcp/handlers_codeintel.go GrepObjects.object_urls yes
internal/mcp/handlers_codeintel.go GrepPackages.packages yes
internal/mcp/handlers_codeintel.go GrepPackages.object_types yes

DebuggerGetVariables was the only affected tool.

Verification

  • go build ./... — compiles cleanly
  • go test ./... — all unit tests pass (including internal/mcp package tests)
ok  	github.com/oisee/vibing-steampunk/internal/mcp	0.355s
ok  	github.com/oisee/vibing-steampunk/pkg/adt	0.550s
ok  	github.com/oisee/vibing-steampunk/pkg/cache	0.345s
ok  	github.com/oisee/vibing-steampunk/pkg/config	0.504s
ok  	github.com/oisee/vibing-steampunk/pkg/dsl	0.665s
ok  	github.com/oisee/vibing-steampunk/pkg/scripting	0.505s

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tool Error DebuggerGetVariables

1 participant