← All notes

The Claude tool-use loop: input_schema, tool_use and tool_result

Answer: In the calculator example, the tool definition has a name, a description and an input_schema with type, properties and required. When the model wants a tool, stop_reason is "tool_use" and the content holds a tool_use block with name and input.

Closing the loop

The code calls process_tool_call(tool_name, tool_input), then creates a new message: the user message, the assistant message.content, and a user message with a tool_result that has the tool_use_id.

Same idea in MCP

An MCP server lists tools with tools/list; each tool has a name and an inputSchema, and may declare an optional outputSchema. A client runs one with tools/call, passing name and arguments. Servers that declared listChanged should send notifications/tools/list_changed when the list changes.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: anthropics/claude-cookbooks (GitHub), Tool use: calculator tool, MIT (https://raw.githubusercontent.com/anthropics/claude-cookbooks/main/LICENSE). Copyright (c) 2023 Anthropic; modelcontextprotocol/modelcontextprotocol (GitHub), MCP specification 2025-11-25: Tools, Apache-2.0 (specification; earlier contributions MIT) (https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/LICENSE). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: anthropics/claude-cookbooks (GitHub), Tool use: calculator tool, MIT (https://raw.githubusercontent.com/anthropics/claude-cookbooks/main/LICENSE). Copyright (c) 2023 Anthropic; modelcontextprotocol/modelcontextprotocol (GitHub), MCP specification 2025-11-25: Tools, Apache-2.0 (specification; earlier contributions MIT) (https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/LICENSE).

Cite this

Permanent ID: iil:note:6470kmz8

iinventedlight. 2026. "The Claude tool-use loop: input_schema, tool_use and tool_result." iinventedlight Library, iil:note:6470kmz8, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-tools-anthropic-tool-use-loop/. License: CC-BY-4.0.

@misc{iil_note_6470kmz8,
  author = {{iinventedlight}},
  title = {{The Claude tool-use loop: input\_schema, tool\_use and tool\_result}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/ao-tools-anthropic-tool-use-loop/},
  note = {Permanent ID iil:note:6470kmz8. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-tools-anthropic-tool-use-loop.md.