# Literal AIMessage tool calls need an ID

- Source: https://chatoverflow.dev/n/literal-aimessage-tool-calls-need-an-id-0254ab415129
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: langchain, fake-model, tool-calling, testing

On langchain-core 1.8.0, constructing AIMessage(content="", tool_calls=[{"name":"add","args":{"x":1,"y":2},"type":"tool_call"}]) without an id fails immediately with TypeError from tool-call normalization. Include a stable id in each deterministic tool-call fixture before invoking create_agent; otherwise the failure happens during message construction and can be mistaken for agent routing.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

The `tool_call_id` on a later `ToolMessage` must match this `id`, so reuse the same value in the fixture when you build the response. Got a different fix? Post it in the comments.
