Skip to content

Conversation

@Dumbris
Copy link
Contributor

@Dumbris Dumbris commented Jan 27, 2026

Summary

Fixes #278 - Gemini 3 Pro via Antigravity crashes when generating tool calls with nested JSON objects in the intent parameter.

Changes:

  • Remove operation_type requirement from intent parameter - now inferred from tool variant
  • Make intent parameter optional (empty {} now works)
  • Simplify validation to only check optional fields (data_sensitivity, reason)
  • Update tests and documentation

Before (required):

{
  "name": "call_tool_read",
  "arguments": {
    "name": "github:list_repos",
    "args_json": "{}",
    "intent": {
      "operation_type": "read"  // <-- REQUIRED, caused crash on Gemini 3
    }
  }
}

After (optional):

{
  "name": "call_tool_read",
  "arguments": {
    "name": "github:list_repos",
    "args_json": "{}"
    // No intent needed! operation_type is inferred from tool variant
  }
}

The tool variant already declares the intent (call_tool_read = read operation), so requiring operation_type in the intent object was redundant. This simplification enables compatibility with models that have issues generating nested JSON objects.

Test plan

  • Unit tests updated and passing (go test ./internal/contracts/... ./internal/server/... -run "Intent")
  • E2E tests updated and passing
  • Build passes
  • Documentation updated

🤖 Generated with Claude Code

…ing it

This fixes #278 where Gemini 3 Pro via Antigravity crashed when
generating tool calls with nested JSON objects in the intent parameter.

Changes:
- Remove operation_type requirement from intent parameter
- Infer operation_type automatically from tool variant:
  - call_tool_read → "read"
  - call_tool_write → "write"
  - call_tool_destructive → "destructive"
- Make intent parameter optional (empty {} now works)
- Update validateIntentForVariant to return (intent, error) and create
  default intent if nil
- Simplify Validate() to only check optional fields (data_sensitivity,
  reason)
- Update tests to reflect new behavior
- Update documentation

The two-key security model was redundant - the tool variant already
declares intent. This simplification enables compatibility with models
that have issues generating nested JSON objects.

Closes #278

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 27, 2026

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5d2a9f9
Status: ✅  Deploy successful!
Preview URL: https://d9f319e5.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-infer-intent-operation-t.mcpproxy-docs.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/infer-intent-operation-type

Available Artifacts

  • archive-darwin-amd64 (23 MB)
  • archive-darwin-arm64 (21 MB)
  • archive-linux-amd64 (12 MB)
  • archive-linux-arm64 (11 MB)
  • archive-windows-amd64 (23 MB)
  • archive-windows-arm64 (20 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (26 MB)
  • installer-dmg-darwin-arm64 (23 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 21398605626 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

Dumbris and others added 6 commits January 27, 2026 14:37
Gemini 3 Pro has strict limitations with nested objects in tool schemas:
- Maximum 4-level nesting depth
- Cannot handle untyped/schema-less objects
- Strict schema validation

Remove the `intent` object parameter entirely from call_tool_* schemas.
The operation_type is already inferred from the tool variant, and the
optional audit fields (data_sensitivity, reason) can be added back later
if needed via flat string parameters.

This should resolve the "improper format stop reason" errors when Gemini
tries to generate tool calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace nested intent object with flat string parameters to avoid
Gemini 3 Pro's strict limitations with nested JSON objects:

- Replace `intent: { data_sensitivity, reason }` with flat params:
  - `intent_data_sensitivity` - optional data classification
  - `intent_reason` - optional explanation for audit trail

- Update extractIntent() to read from flat parameters
- operation_type still inferred from tool variant (call_tool_read/write/destructive)
- Activity log features preserved - intent metadata recorded in activity records
- Update tests and documentation

Fixes #278

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The CLI was still building a nested intent object which the
server's extractIntent() no longer reads. Updated to use flat
intent_data_sensitivity and intent_reason parameters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove "Optional" from descriptions (models skip optional fields)
- Change "For audit trail" to "Recommended for compliance/accountability"
- Add "Requires intent.operation_type" to main tool descriptions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… fields

- Remove operation_type mentions (inferred from tool name)
- Make intent_data_sensitivity action-oriented: "Classify data being accessed/modified/deleted"
- Make intent_reason a question with examples: "Why is this tool being called?"
- Update retrieve_tools: "Always provide intent_reason and intent_data_sensitivity"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
No longer needed since operation_type is inferred from tool variant.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Dumbris Dumbris merged commit dd9376a into main Jan 27, 2026
25 checks passed
@Dumbris Dumbris deleted the fix/infer-intent-operation-type branch January 27, 2026 13:48
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.

Issues when trying to call MCPProxy call tool with Gemini 3 Pro (Antigravity)

2 participants