PaPoo
cover

What is tool result / tool message?

A tool result or tool message is the message an app sends back to the model after the model asks it to use an external tool, such as a search API, calculator, database query, or function call.

Why it matters

LLMs do not reliably know fresh data, private data, or exact computations on their own. A tool result lets the system return the tool’s output to the model in a structured way so the model can continue the conversation with real evidence.

You’d use it whenever the model needs to:

In practice, this is the handshake that makes tool use work: the model asks, the system executes, then the tool result comes back for the model to read.

How it works

  1. The model requests a tool.
    The model emits a tool call or function call with arguments, such as “look up order 123”.

  2. Your app runs the tool outside the model.
    The orchestrating code, not the model, makes the actual API request, database query, or function call.

  3. The app returns a tool result / tool message.
    The output is sent back in a special message that is linked to the original tool call. Depending on the framework, this may be called a tool result, tool message, or just a tool response.

  4. The model reads that result and continues.
    The model uses the returned data to answer the user, ask for another tool, or decide the next step.

This separation is important: the model proposes the action, but the system supplies the result.

Tiny concrete example

User: “What is the status of order 123?”

Model:

{
  "tool_call": "get_order_status",
  "arguments": { "order_id": "123" }
}

App executes the call and returns a tool message:

{
  "tool_message": {
    "tool_call_id": "abc123",
    "content": "Order 123 is shipped and expected on Friday."
  }
}

Model then replies to the user:
“Order 123 has shipped and is expected on Friday.”

Common pitfalls / when NOT to use it

Related terms

Related terms

同じ著者の記事