Prerequisites
What are you trying to do that currently feels hard or impossible?
toolbox-core supports TelemetryAttributes and sends client metadata such as model, user ID, and agent ID through MCP _meta for extended telemetry / SQLCommenter. This was added in #632 / #634.
However, toolbox-adk does not currently expose a way to pass those telemetry attributes through ToolboxToolset or ToolboxTool. ADK users can load and invoke Toolbox tools, but cannot attach per-invocation telemetry metadata from ADK context, such as the current ToolContext, session user, agent ID, or model.
This means ADK applications cannot use the core telemetry attribute flow without bypassing the ADK wrapper.
Suggested Solution(s)
Add a telemetry_attributes argument to toolbox_adk.ToolboxToolset and toolbox_adk.ToolboxTool.
Support:
- A static
TelemetryAttributes instance.
- A sync or async zero-argument callback.
- A sync or async one-argument callback receiving ADK
ToolContext.
This should follow the existing ADK callback pattern from #579, where one-argument callbacks receive ToolContext.
At invocation time, resolve telemetry attributes per call and apply them with core_tool.add_telemetry_attributes(...).
Important: context-derived telemetry should not mutate the shared wrapped core tool, otherwise user/agent metadata from one invocation can leak into later invocations
Alternatives Considered
No response
Additional Details
This extends the core telemetry implementation from #634 into the ADK integration only. It should preserve existing ADK auth behavior and should include tests for:
- Passing telemetry attributes from
ToolboxToolset into wrapped tools.
- Resolving dynamic telemetry attributes per invocation from
ToolContext.
- Ensuring the base core tool is not mutated across calls.
- Ensuring user identity token cleanup still happens if telemetry resolution fails.
Prerequisites
What are you trying to do that currently feels hard or impossible?
toolbox-coresupportsTelemetryAttributesand sends client metadata such as model, user ID, and agent ID through MCP_metafor extended telemetry / SQLCommenter. This was added in #632 / #634.However,
toolbox-adkdoes not currently expose a way to pass those telemetry attributes throughToolboxToolsetorToolboxTool. ADK users can load and invoke Toolbox tools, but cannot attach per-invocation telemetry metadata from ADK context, such as the currentToolContext, session user, agent ID, or model.This means ADK applications cannot use the core telemetry attribute flow without bypassing the ADK wrapper.
Suggested Solution(s)
Add a
telemetry_attributesargument totoolbox_adk.ToolboxToolsetandtoolbox_adk.ToolboxTool.Support:
TelemetryAttributesinstance.ToolContext.This should follow the existing ADK callback pattern from #579, where one-argument callbacks receive
ToolContext.At invocation time, resolve telemetry attributes per call and apply them with
core_tool.add_telemetry_attributes(...).Important: context-derived telemetry should not mutate the shared wrapped core tool, otherwise user/agent metadata from one invocation can leak into later invocations
Alternatives Considered
No response
Additional Details
This extends the core telemetry implementation from #634 into the ADK integration only. It should preserve existing ADK auth behavior and should include tests for:
ToolboxToolsetinto wrapped tools.ToolContext.