Tool search
openrouter:tool_search
Keeps large tool libraries out of the prompt. Mark your own tools defer_loading and the model searches for the ones it needs, so hundreds of definitions stop costing input tokens on every turn and tool selection stays accurate.
How it works
For large tool libraries: roughly more than 10 tools or 10k tokens of definitions. Below that, standard tool calling is simpler.
Your app marks function tools defer_loading, so they stay out of the prompt.
Your model searches the deferred tools with a pattern when it needs one.
OpenRouter reveals the best matches by name, description, and arguments.
Your app handles calls to revealed tools like any other function call.
Providers and pricing
Standard model token costs apply to every request.
Using this tool
Mark your own function tools defer_loading. OpenRouter runs the search server-side and reveals matching tools to the model, and your application handles the revealed function calls as it would any other.
Available through the API. Only affects requests that mark other tools defer_loading, which the chatroom does not do.
Supported APIs: Responses and Anthropic Messages.
curl https://openrouter.ai/api/v1/responses \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.2",
"tools": [
{
"type": "openrouter:tool_search"
},
{
"type": "function",
"name": "book_restaurant",
"description": "Reserve a restaurant table for a party at a given date and time.",
"parameters": {
"type": "object",
"properties": {
"party_size": {
"type": "integer",
"description": "Number of guests."
},
"datetime": {
"type": "string",
"description": "Reservation time as an ISO 8601 timestamp."
}
},
"required": [
"party_size",
"datetime"
]
},
"defer_loading": true
},
{
"type": "function",
"name": "create_calendar_event",
"description": "Add an event to the user’s calendar.",
"parameters": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Event title."
},
"start": {
"type": "string",
"description": "Start time as an ISO 8601 timestamp."
}
},
"required": [
"title",
"start"
]
},
"defer_loading": true
}
],
"input": "Book me a table for four tomorrow night and add it to my calendar."
}'Setup, parameters, and examples in the docs.
Read the integration guide