Skip to content

Commit adc661e

Browse files
Document _meta propagation conventions (#297)
Update extensibility documentation with: - Type annotation for _meta field: { [key: string]: unknown } - W3C trace context propagation conventions (traceparent, tracestate, baggage) - Example showing traceparent in _meta
1 parent 981b23b commit adc661e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/protocol/extensibility.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Agent Client Protocol provides built-in extension mechanisms that allow impl
77

88
## The `_meta` Field
99

10-
All types in the protocol include a `_meta` field that implementations can use to attach custom information. This includes requests, responses, notifications, and even nested types like content blocks, tool calls, plan entries, and capability objects.
10+
All types in the protocol include a `_meta` field with type `{ [key: string]: unknown }` that implementations can use to attach custom information. This includes requests, responses, notifications, and even nested types like content blocks, tool calls, plan entries, and capability objects.
1111

1212
```json
1313
{
@@ -23,12 +23,19 @@ All types in the protocol include a `_meta` field that implementations can use t
2323
}
2424
],
2525
"_meta": {
26+
"traceparent": "00-80e1afed08e019fc1110464cfa66635c-7a085853722dc6d2-01",
2627
"zed.dev/debugMode": true
2728
}
2829
}
2930
}
3031
```
3132

33+
Clients may propagate fields to the agent for correlation purposes, such as `requestId`. The following root-level keys in `_meta` **SHOULD** be reserved for [W3C trace context](https://www.w3.org/TR/trace-context/) to guarantee interop with existing MCP implementations and OpenTelemetry tooling:
34+
35+
- `traceparent`
36+
- `tracestate`
37+
- `baggage`
38+
3239
Implementations **MUST NOT** add any custom fields at the root of a type that's part of the specification. All possible names are reserved for future protocol versions.
3340

3441
## Extension Methods

docs/rfds/meta-propagation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ Here are several MCP SDKs that propagate W3C trace-context in `_meta`:
6262

6363
## Revision history
6464

65+
- 2025-12-04: Implementation in extensibility docs
6566
- 2025-11-28: Initial draft

0 commit comments

Comments
 (0)