Skip to content

Empty function tool parameters cause 500 error with Anthropic provider #6017

@derekhiggins

Description

@derekhiggins

Empty function tool parameters cause 500 error with Anthropic provider

Type: Bug

Description

When a function tool is defined with empty parameters ("parameters": {}), the Responses API forwards it as-is to the inference provider. Anthropic's OpenAI-compatible endpoint rejects this because parameters.type is a required field, returning:

500 - tools.0.function.parameters.type: Field required

Similarly, if parameters contains properties but no type field, the request is also rejected.

Steps to Reproduce

  1. Configure OGX with remote::anthropic provider
  2. Create a response with a no-argument function tool:
client.responses.create(
    model="anthropic/claude-sonnet-4-6",
    input=[{"role": "user", "content": "what's the current time?"}],
    tools=[{
        "type": "function",
        "name": "get_current_time",
        "description": "Get the current time",
        "parameters": {},
    }],
)
  1. Server returns 500

Verified Against Anthropic API

input_schema Result Error
{} 400 tools.0.custom.input_schema.type: Field required
{"properties": {"tz": {"type": "string"}}} 400 tools.0.custom.input_schema.type: Field required
{"type": "object"} 200 Works

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions