-
Notifications
You must be signed in to change notification settings - Fork 136
docs: Better document _meta field type and usage #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,7 +7,7 @@ The Agent Client Protocol provides built-in extension mechanisms that allow impl | |||||||||||||||||
|
|
||||||||||||||||||
| ## The `_meta` Field | ||||||||||||||||||
|
|
||||||||||||||||||
| 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. | ||||||||||||||||||
| 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. | ||||||||||||||||||
|
|
||||||||||||||||||
| ```json | ||||||||||||||||||
| { | ||||||||||||||||||
|
|
@@ -23,12 +23,19 @@ All types in the protocol include a `_meta` field that implementations can use t | |||||||||||||||||
| } | ||||||||||||||||||
| ], | ||||||||||||||||||
| "_meta": { | ||||||||||||||||||
| "traceparent": "00-80e1afed08e019fc1110464cfa66635c-7a085853722dc6d2-01", | ||||||||||||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this wasn't in the RFD, but figured it can re-enforce below. happy to remove it though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing example of Even with the follow-on explanation, I fear the presence of the |
||||||||||||||||||
| "zed.dev/debugMode": true | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| 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: | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| - `traceparent` | ||||||||||||||||||
| - `tracestate` | ||||||||||||||||||
| - `baggage` | ||||||||||||||||||
|
|
||||||||||||||||||
| 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. | ||||||||||||||||||
|
|
||||||||||||||||||
| ## Extension Methods | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This elaboration is TypeScript-centric. I think we can make it more JSON-centric.