Tool Format Normalization

The marketplace normalizes tool definitions from different clients before forwarding to providers.

Supported Formats

SourceFormatAction
OpenAI standard{ type: "function", function: { name, ... } }Pass through
Cursor minimal{ function: { name, ... } } (no type)Add type: "function"
Anthropic-native{ name, description, input_schema }Convert to OpenAI format
Top-level OpenAI{ type: "function", name, parameters }Wrap in function object

Non-Function Tools

Cursor sends non-function tools that most providers reject:

  • computer_20241022
  • text_editor_20241022
  • bash_20241022

These are stripped before forwarding. If a tool_choice was forcing a stripped tool, it's reset to auto.

Strict Validation

  • typeof name === 'string' (not just truthiness)
  • Tools with invalid structure are rejected, not forwarded
  • Applied identically to both streaming and non-streaming endpoints
  • 19 dedicated unit tests cover all formats

Why This Matters

Without normalization, Cursor users would get 400 errors from most providers. The marketplace handles it transparently — you just use Cursor normally.