In v0.5.x, tool definitions are no longer encoded as multiple flat, indexed attributes (e.g., gen_ai.tool.definitions.0.name). Instead, they are encoded as a single JSON-array attribute under GenAIAttributes.GEN_AI_TOOL_DEFINITIONS.
Dashboard Impact: Dashboards that expand gen_ai.tool.definitions.{i}.name will no longer work. You must parse the JSON value of gen_ai.tool.definitions instead.
import json
tool_defs = [
{
"name": "my_tool",
"description": "Does something",
"parameters": {...},
}
]
span.set_attribute(GenAIAttributes.GEN_AI_TOOL_DEFINITIONS, json.dumps(tool_defs))