Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Function definition for tool calling

Example Usage

import { ChatFunctionToolFunctionFunction } from "@openrouter/sdk/models";

let value: ChatFunctionToolFunctionFunction = {
  name: "get_weather",
};

Fields

FieldTypeRequiredDescriptionExample
descriptionstring:heavy_minus_sign:Function description for the modelGet the current weather for a location
namestring:heavy_check_mark:Function name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)get_weather
parametersRecord<string, *any*>:heavy_minus_sign:Function parameters as JSON Schema object{"properties": {"location": {"description": "City name","type": "string"}
},
“required”: [
“location”
],
“type”: “object”
}
strictboolean:heavy_minus_sign:Enable strict schema adherencefalse