"Tool use" (sometimes called function calling) is the pattern where you describe functions your application can perform — look up an order, query a database, send an email draft for review — and Claude decides when to invoke them. Claude never executes anything itself for client-side tools: it emits a structured request, your code runs the function, and you send the result back. Because Claude Platform on AWS exposes the Claude API surface directly at /v1/messages, everything you know from first-party tool use carries over unchanged, including full support for all tool use in the official docs.
The four-step production loop
A tool-use exchange is a loop, not a single call. First, you send a request that includes a tools array — each tool has a name, a description, and a JSON schema for its inputs. Second, if Claude decides a tool is needed, the response comes back with stop_reason: "tool_use" and one or more tool_use content blocks, each carrying an id, the tool name, and the parsed input. Third, your application executes the real function locally. Fourth, you append Claude's assistant message to the conversation and add a new user message containing a tool_result block that references the tool_use id — then call the API again. The loop repeats until Claude answers with plain text.
from anthropic import AnthropicAWS
client = AnthropicAWS() # AWS_REGION + ANTHROPIC_AWS_WORKSPACE_ID env vars
tools = [{"name": "get_order", "description": "Fetch an order by ID",
"input_schema": {"type": "object", "required": ["order_id"],
"properties": {"order_id": {"type": "string"}}}}]
messages = [{"role": "user", "content": "Where is order A-1042?"}]
kwargs = dict(model="claude-opus-4-8", max_tokens=1024, tools=tools)
resp = client.messages.create(messages=messages, **kwargs)
while resp.stop_reason == "tool_use":
block = next(b for b in resp.content if b.type == "tool_use")
result = lookup_order(block.input["order_id"]) # your code
messages += [{"role": "assistant", "content": resp.content},
{"role": "user", "content": [{"type": "tool_result",
"tool_use_id": block.id, "content": str(result)}]}]
resp = client.messages.create(messages=messages, **kwargs)
Note the client: AnthropicAWS() from the anthropic package, with bare first-party model IDs like claude-opus-4-8 — no Bedrock-style prefixes. The SDK handles SigV4 request signing and the workspace header for you.
Details that bite in production
Return thinking blocks untouched. On models with thinking enabled, the assistant message that requested the tool may include a thinking block. When you post the tool result, you must return the entire unmodified thinking block, signature included — modified blocks are rejected via cryptographic signature verification. The safest habit is what the sample does: append resp.content as-is.
Budget for prompt overhead. Enabling tools adds a hidden system-prompt cost. On Claude Opus 4.8 the tool-use system prompt adds 290 input tokens with tool_choice set to auto or none, and 410 with any or a forced tool; Sonnet 5 adds 354/474. Tool definitions themselves also count as input tokens on every turn — one more reason to keep descriptions crisp and consider prompt caching for large tool sets.
Handle the non-happy paths. Your loop should also expect stop_reason: "max_tokens" (the response was cut off — raise the limit and retry) and, on newer models, "refusal". Cap loop iterations so a confused agent cannot spin forever, and put tool failures back into the conversation as an error tool_result rather than crashing — Claude usually recovers gracefully when told what went wrong.
aws-external-anthropic:CreateInference, which maps to POST /v1/messages. Beta variants of a route enabled via the anthropic-beta header need no separate action. That means IAM controls who can call Claude, not which tools Claude may use — restrict dangerous tools in your application code.Server-side tools work here too
Beyond client-side tools, Claude Platform on AWS supports Anthropic's server-executed tools — web search, web fetch, and code execution in Anthropic's managed sandbox — which is a genuine differentiator: those are not available on Amazon Bedrock, and Vertex AI has only partial coverage. If your agent design leans on those tools, this platform (or the first-party API) is where it can run inside AWS.
Where to go next
For strict schema enforcement built on the same mechanism, read Structured JSON Outputs on Claude Platform on AWS. The feature matrix shows tool availability across all four platforms, and the tool_choice guide covers forcing or forbidding tool calls.