Skip to content

Send client telemetry attributes in _meta for Extended Telemetry and SQLCommenter #632

@AjmeraParth132

Description

@AjmeraParth132

Prerequisites

What are you trying to do that currently feels hard or impossible?

The server needs client identity and user-provided metadata (model, user ID, agent ID) on tools/call to propagate into database query logs via SQLCommenter. Currently _meta only carries traceparent/tracestate

Suggested Solution(s)

  1. Add telemetry_attributes to MCPMeta with serialization alias dev.mcp-toolbox/telemetry.
  2. Accept at call time: pop telemetry_attributes from kwargs before signature validation:
  3. Build payload in transport: always include client.name + client.version from transport state; merge user-provided attrs with client. prefix. Attach to _meta on every tools/call

Alternatives Considered

No response

Additional Details

  • Only tools/call affected for v1, and telemetry attributes are directly passed to the server.
  • An extension to the project will be to enable the same telemetry in initialize and tools/list, and export them with current telemetry as well

Metadata

Metadata

Assignees

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions