1. Declare tools
- Anthropic Messages API
toolswithname,description,input_schema- OpenAI Responses API
- Tools with
type: "function",name,description,parameters
Tool use lets a model return a structured call to a function you define or a vendor provides. The request loop, client versus server tools, and a quick check.
Tool use, also called function calling, lets a language model return a structured call to a tool you describe, instead of only text. Your application runs the call and sends back the result, or the vendor runs it for server-side tools. The model never executes your code itself.
Four quick questions, then a straight answer.
From your answers, this is quietly costing you traffic and nobody has the hours to chase it. Scaplet finds every affected page, drafts the fixes and tracks how AI answers mention you.
A data platform shipped 46 fixes without a ticket.
This looks handled. Re-check after a redesign, a migration or a big content push; that is when it breaks.
Your site is small and you have the time. Work through the steps on this page, starting with the pages that get the most traffic.
input_schema. Claude decides, from the request and the description, whether to call it. If it does, the response carries stop_reason: "tool_use" and one or more tool_use blocks. Your code runs the operation and sends back a tool_result. OpenAI's flow has the same shape with different item names.tools with name, description, input_schematype: "function", name, description, parameterstool_use block, stop_reason: "tool_use"function_call item with call_id, name, argumentstool_result block with the matching tool_use_idfunction_call_output item with the matching call_idnamedescriptioninput_schemarequired fieldsstrict: true{
"name": "get_weather",
"description": "Get the current weather for a given location.",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}bash, text_editorweb_search, web_fetch, code_execution, tool_searchAnthropic notes that tool definitions, tool_use blocks and tool_result blocks all count toward input and output tokens, and that tool use adds a model-specific system prompt overhead. Keep descriptions short and the tool list small. OpenAI's guidance suggests keeping the initially available functions under about 20, and using tool search for larger sets.
Tool use is the building block of AI agents, and the Model Context Protocol is a standard way to package tools so many applications can share them.
Say when to use the tool and what it returns.
OpenAI advises not asking the model for arguments your code already has.
OpenAI recommends enums and structured objects to prevent invalid inputs.
Handle zero, one or several calls in a response. Anthropic's disable_parallel_tool_use and OpenAI's parallel_tool_calls: false limit this.
Send a prompt that clearly maps to one tool and confirm the response contains a tool call with sensible arguments.
Send a prompt outside the tool's scope and confirm the model answers directly instead of forcing a call.
Return a tool_result or function_call_output using the matching ID, and confirm the final answer uses it.
2 questions people ask next, answered from the sources on this page.
Yes. Anthropic's docs say tool use is also called function calling. Vendors differ in field names and response items, so check each vendor's reference when you port code.
Yes. Both vendors document a tool-choice setting. OpenAI lists auto, required, a specific function, an allowed subset, and none. Anthropic's default is {"type": "auto"}, with options to require a call.
The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.