PaPoo
cover

What is a tool call ID?

A tool call ID is a unique identifier attached to one specific tool invocation so the model and your application can refer to that exact call again later.

Why it matters

Tool calls are often part of a multi-step exchange: the model asks for a function or external service to run, your app executes it, and then you send the result back. The tool call ID is what keeps that round-trip unambiguous.

You reach for it when:

In practice, it is the bookkeeping key that prevents “which result belongs to which call?” confusion.

How it works

  1. The model emits a tool call with an ID.

    • The ID is usually opaque, meaning you should treat it as a token, not parse meaning from it.
  2. Your application executes the requested tool.

    • For example, it may call a database, calculator, search API, or weather service.
  3. You send the tool output back and include the same tool call ID.

    • This lets the model connect the returned result to the exact call it made.
  4. If there are multiple tool calls, each one has its own ID.

    • That is especially important when calls happen in parallel or in a chain.

The exact field name and message shape depend on the API, but the core idea is stable across modern tool-using LLM systems: an ID ties a tool request to its corresponding result.

Tiny concrete example

{
  "tool_call_id": "call_123",
  "name": "get_weather",
  "arguments": { "city": "Paris" }
}

Your app runs the tool, then returns:

{
  "tool_call_id": "call_123",
  "output": "18°C and sunny"
}

That ID tells the system, “this output belongs to that exact weather request.”

Common pitfalls / when NOT to use it

In short: if you are building an agent or tool-using chat flow, the tool call ID is the glue between the model’s request and your tool’s response.

Related terms

同じ著者の記事