Skip to content

toAnthropicToolSchema

function toAnthropicToolSchema(node): Record<string, unknown>;

Defined in: core/src/schema.ts:401

Sanitize a tool’s JSON Schema for Anthropic’s Messages API.

Anthropic rejects schemas where the root is an anyOf / oneOf / allOf union, requiring a root object schema ({ type: "object", properties: ... }).

Parameter Type
node unknown

Record<string, unknown>