Skip to Content

What does the gen_ai.tool.name attribute mean in Rius?

In Rius, gen_ai.tool.name holds the tool’s own name, such as get_weather, and it is set on execute_tool spans, the spans that record a tool running. It is never the span name. Rius reads it, together with the tool call id and tool type, to tell you which tool a span ran.

How it works

  • What it holds. The tool’s own name, for example get_weather or calculator. The OpenTelemetry GenAI conventions define it, at Development stability, as the name of the tool used by the agent. Its registry entry links to the upstream definition. The span name is a separate thing: by the GenAI naming convention a tool span is called execute_tool get_weather, and the attribute carries only get_weather.
  • Which spans carry it. Spans for tool executions, the ones whose gen_ai.operation.name is execute_tool or whose openinference.span.kind is TOOL. Set either one and Rius derives the other. Model-call spans do not carry it. They carry gen_ai.tool.definitions instead, the tool definitions the model was shown.
  • Attributes that sit beside it. gen_ai.tool.call.id is the id of the model’s tool call that this execution answers. gen_ai.tool.type is a value such as function, extension or datastore. On an execute_tool span, gen_ai.agent.name is the agent executing the tool.
  • MCP tools. A tool called over the Model Context Protocol is an execute_tool span like any other, with mcp.method.name set to tools/call. Rius uses that attribute to tell MCP tools from local ones when it reports how many context tokens MCP tools took.
  • Tool arguments and results. The arguments and result of a tool call arrive as gen_ai.tool.call.arguments and gen_ai.tool.call.result. Rius moves them to input.value and output.value, so you search on those two keys.
  • Other conventions. For OpenLLMetry (Traceloop) spans, Rius turns the decorated entity’s name into the tool name at ingest. If you send spans from OpenLLMetry, you do not need to set the attribute yourself. Native gen_ai.* keys always win, and normalization only fills gaps.
  • No cost from it. Cost comes from the request model and the token counts on model-call spans, not from tool attributes. Never send a cost attribute.

Set it up

  1. Send spans to Rius over OTLP/HTTP with your API key. The full contract is on the span attribute reference.
POST https://ingest.eu.console.rius-glassflow.com/v1/traces Authorization: Bearer <your API key> Content-Type: application/x-protobuf
  1. For each tool execution, create a span and set gen_ai.operation.name to execute_tool. Alternatively set openinference.span.kind to TOOL. Rius derives the other attribute.
  2. Set gen_ai.tool.name to the tool’s own name, and name the span the way the conventions ask, the operation followed by the tool: execute_tool get_weather.
  3. Add gen_ai.tool.call.id with the id from the model’s tool call, and gen_ai.tool.type if you know it.
  4. If the tool runs over MCP, also set mcp.method.name to tools/call.
  5. In the model-call span that requested the tool, put the tool call in gen_ai.output.messages as a tool_call part. The part’s name and id live inside that JSON message. They are not span attributes, and the later tool_call_response part refers back to the same id:
[ { "role": "assistant", "parts": [ {"type": "tool_call", "id": "call_1", "name": "calculator", "arguments": "{\"expr\": \"2+2\"}"} ] }, { "role": "tool", "parts": [{"type": "tool_call_response", "id": "call_1", "response": "4"}] } ]

For a full walkthrough of sending traces from any OpenTelemetry source, see Trace LLM calls with OpenTelemetry.

What you get

  • Tool spans that are identified by the tool’s own name, separate from the span name, so you can search and read them consistently.
  • A link between each tool execution and the model’s tool call it answers, through gen_ai.tool.call.id.
  • Tool spans classified as TOOL in trace views, so the kind filters pick them up.
  • Tool input and output rendered like any other span’s, because the arguments and result are moved to input.value and output.value.
  • For MCP tools, a report of how many context tokens they took and their share of the total, when at least one span in the trace carries mcp.method.name. Without it the MCP share is unknown, not zero.

When something else fits

  • If your tool spans come from OpenLLMetry or another supported convention, you can send them as they are, since Rius normalizes them at ingest.
  • If you want to know what a model was offered rather than what ran, read gen_ai.tool.definitions on the model-call span, not gen_ai.tool.name.

Still stuck? Get help

Last updated on