Adovo

Applied AI

Agents SDK rejects tool arguments that match its JSON schema

Diagnose Pydantic strict-mode validation failures in OpenAI Agents SDK function tools before blaming the model.

October 29, 2026

An agent calls a function tool with JSON that matches the tool’s published schema, yet the tool never runs. An open Agents SDK issue reproduces this with Pydantic strict-mode Enum, date, and other typed fields on SDK 0.24.0. The reporter traces the failure to validation of decoded JSON as Python objects. That is distinct from the SDK’s strict_mode setting for JSON Schema; confusing the two can send debugging in the wrong direction.

Capture the boundary that rejects the call

Log a redacted tool name, schema version, argument shape, SDK version, and validation error in a safe development environment. Confirm whether the model supplied the string representation the JSON schema requests and whether the decorated function body executed. A generic “An error occurred while running the tool” message does not prove bad model reasoning. The official tool guide explains automatic schema creation and Pydantic-backed validation.

Reproduce with a minimal strict model

Take one failing Enum or date field and run a scripted tool call without a live model. The issue includes such a reproduction and compares tool validation with structured output validation. Pydantic’s strict-mode documentation distinguishes JSON and Python validation behavior for some types. Verify whether the installed SDK release still shows the mismatch before changing production schemas.

Keep the application contract intact

For an immediate mitigation, consider a narrow tool-boundary adapter that accepts JSON-safe primitives and explicitly validates and converts them inside the function, with tests for invalid and valid values. Do not turn off validation across the agent or accept arbitrary strings to make one call pass. If the task performs a sensitive action, retain the same semantic checks after conversion. Track the upstream fix and remove the adapter only when the deployed SDK passes the same test.

Adovo’s view

The model can only meet a contract the runtime actually accepts. When a valid-looking tool call fails, inspect schema, transport, and validation as one boundary. Reliability comes from making that boundary explicit, not from asking the model to try harder.

Continue exploring

Applied AI

AI AgentsOpenAI Agents SDK

An agent handoff fails on a stale specialist name

A model can emit invalid structured handoff arguments and terminate the run. Validate the handoff contract and return a recoverable user path.

Read more

Applied AI

Realtime AgentsTool Calls

A realtime agent says an interrupted action already happened

When a user interrupts an async tool call, the agent may claim completion before the side effect is confirmed. Track action state explicitly.

Read more

Applied AI

SQL AgentsData Governance

A SQL agent knows the schema and still chooses the wrong table

DDL alone rarely tells an agent which tables are current, meaningful or safe to query. Give it bounded evidence and verify the generated SQL.

Read more
Explore applied AI services →