Tool Format Normalization
The marketplace normalizes tool definitions from different clients before forwarding to providers.
Supported Formats
| Source | Format | Action |
|---|---|---|
| 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 |
OpenAI standardFormat ·
{ type: "function", function: { name, ... } }Action · Pass throughCursor minimalFormat ·
{ function: { name, ... } } (no type)Action · Add type: "function"Anthropic-nativeFormat ·
{ name, description, input_schema }Action · Convert to OpenAI formatTop-level OpenAIFormat ·
{ type: "function", name, parameters }Action · Wrap in function object- OpenAI function tool
- Anthropic tool
- Legacy function block
- Provider-specific shape
One canonical function toolwhat the seller actually receives
Non-function toolsdropped, and tool_choice resets to auto
Non-Function Tools
Cursor sends non-function tools that most providers reject:
computer_20241022text_editor_20241022bash_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.