Does OpenTelemetry's tool-call-id attribute come from the model, or from the client library?
The model’s, when the model or provider supplies one. OpenTelemetry’s gen_ai.tool.call.id attribute is now supposed to carry that exact identifier, not one the instrumentation library invented on its own; the spec doesn’t say what a library should record when no id was supplied. The reason for the rule is correlation: the id is what lets you line up a tool’s execution span with the specific call the model asked for, and an invented id breaks that link the moment two similar tool calls run close together.
The rule still says SHOULD rather than MUST, because a library watching its client’s API calls often can’t tell whether an id it sees came back from the provider or was generated locally before the request went out. What changed is the execute_tool span itself: the attribute is now conditionally required there whenever the model did supply an id, closing the gap where a library could skip recording one it actually had. This is one piece of what instrumentation is for: recording enough about a step that something downstream can trust which call it belongs to.
published