Skip to content

Grok: 400 unsupported tool field: max_uses -- web search never runs #108

Description

@AlexanderKugel

Environment

claude-code-proxy v0.1.34
Claude Code 2.1.220 (VS Code extension and CLI)
Provider: grok, model grok-4.6

Problem

The Grok proxy rejects any tool declaration that carries max_uses. It returns a 400, and the request never reaches xAI. Claude Code puts max_uses on its own WebSearch tool, so every session that declares web search hits this.


Example 1 -- a WebSearch tool with a use cap

How to reproduce

curl -s -X POST http://$PROXY_HOST:$PROXY_PORT/v1/messages \
  -H 'content-type: application/json' -H 'authorization: Bearer unused' \
  -d '{"model":"grok-4.6","max_tokens":64,
       "messages":[{"role":"user","content":"hi"}],
       "tools":[{"name":"WebSearch","description":"Search the web","max_uses":6,
                 "input_schema":{"type":"object",
                   "properties":{"query":{"type":"string"}},
                   "required":["query"]}}]}'

Observed

API Error: 400 unsupported tool field: max_uses

The request is rejected. The turn produces no reply.

Expected

The request is accepted and the turn replies normally.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions