Skip to content

docs: remove entity wrapper from MCP response examples#360

Merged
igrigorik merged 1 commit intoUniversal-Commerce-Protocol:mainfrom
jamesandersen:fix/remove-mcp-response-wrapper
Apr 20, 2026
Merged

docs: remove entity wrapper from MCP response examples#360
igrigorik merged 1 commit intoUniversal-Commerce-Protocol:mainfrom
jamesandersen:fix/remove-mcp-response-wrapper

Conversation

@jamesandersen
Copy link
Copy Markdown
Contributor

Summary

MCP response examples incorrectly nest the UCP payload under a "checkout", "cart", or "order" key inside structuredContent. Per the OpenRPC specification, the result.name field is descriptive metadata for documentation and tooling — it does not create a wrapper key in the JSON-RPC wire format. The name field only has wire-format significance on params (by-name parameter passing), not on result.

This creates an inconsistency in the current docs: error responses already place the UCP envelope directly in structuredContent (no wrapper), while success responses incorrectly wrap it.

Before (success response)

"structuredContent": {
  "checkout": {
    "ucp": { ... },
    "id": "checkout_abc123",
    ...
  }
}

After (success response — consistent with error responses)

"structuredContent": {
  "ucp": { ... },
  "id": "checkout_abc123",
  ...
}

Files changed

  • docs/specification/checkout-mcp.md — 4 response examples
  • docs/specification/cart-mcp.md — 6 response examples
  • docs/specification/order-mcp.md — 3 response examples
  • docs/specification/overview.md — 1 MCP transport example

Context

Addresses the same issue as #239, which was closed because #216 was expected to include this fix. #216 corrected error response examples but left success responses wrapped.

Checklist

  • Docs only — no schema changes
  • Self-reviewed
  • markdownlint passes
  • cspell passes
  • No new warnings introduced

Copy link
Copy Markdown
Contributor

@alexpark20 alexpark20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch 👏

I think this should be merged into 04-08 release branch as well

Copy link
Copy Markdown
Contributor

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this @jamesandersen. Tracing lineage...

  1. #141 introduced the wrapper when adding tools/call envelope to MCP examples -- input wrapper keys ("checkout", "cart") were copy-pasted into output structuredContent — doh.
  2. #239 opened the correct fix, was closed as "resolved via #216" But 216 rewrote error response examples flat (correct) but didn't touch success responses - miss, doh again.

Once we land #359, this kind of bugs should -- hopefully -- become a thing of the past.

MCP response examples incorrectly nested the UCP payload under a
"checkout", "cart", or "order" key inside structuredContent. The
OpenRPC result.name field is descriptive metadata — it does not
create a wrapper key in the JSON-RPC wire format (per the OpenRPC
spec, name only affects params in by-name mode, not results).

This aligns success response examples with error responses, which
already placed the UCP envelope directly in structuredContent
without a wrapper.

Addresses the same issue as the closed Universal-Commerce-Protocol#239 — that fix was deferred
to Universal-Commerce-Protocol#216, which corrected error responses but left success responses
wrapped.
@igrigorik igrigorik force-pushed the fix/remove-mcp-response-wrapper branch from f64c851 to cb43d77 Compare April 20, 2026 06:12
@igrigorik igrigorik merged commit c44fde5 into Universal-Commerce-Protocol:main Apr 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants