Skip to content

fix(web_fetch): include page body in structuredContent#14

Merged
Dev-vlad merged 1 commit into
mainfrom
fix-web-fetch-structuredcontent-body
Jun 11, 2026
Merged

fix(web_fetch): include page body in structuredContent#14
Dev-vlad merged 1 commit into
mainfrom
fix-web-fetch-structuredcontent-body

Conversation

@Dev-vlad

Copy link
Copy Markdown
Member

Summary

  • In clients that show the model structuredContent instead of the text content blocks (e.g. Claude Cowork), web_fetch returned only the metadata line {format, url, bytes} and the page body never reached the model.
  • Root cause: the body was returned only in the unstructured content text block, while structuredContent carried metadata only. The MCP spec expects the two representations to be functionally equivalent — the other three tools already satisfy this, which is why only web_fetch misbehaved.
  • Fix: include the body as structuredContent.body, matching the equivalence pattern of the other tools.
  • Also: handler-level live check in test:live verifying structuredContent.body matches the text content; version bump to 0.2.2 + changelog entry.

Test plan

  • Unit tests updated to require body in structuredContent (watched them fail before the fix): 109/109 pass
  • Typecheck, lint, build, build:mcpb all clean
  • npm run test:live with a real token: 8/8 PASS, including the new handler-level check
  • Re-verify in Cowork with the released 0.2.2 MCPB (ask the model to quote https://example.com verbatim — body should reach it)

🤖 Generated with Claude Code

web_fetch returned the page body only in the text content block, while
structuredContent carried just {format, url, bytes} metadata. Clients
that show the model structuredContent instead of the content blocks
(e.g. Claude Cowork) received no page body. Include the body as
structuredContent.body so the two representations are functionally
equivalent per the MCP spec, matching the other tools.

Also adds a handler-level live check (test:live) asserting
structuredContent.body matches the text content, and bumps the version
to 0.2.2 with a changelog entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Dev-vlad Dev-vlad merged commit 0f9e680 into main Jun 11, 2026
4 checks passed
@Dev-vlad Dev-vlad deleted the fix-web-fetch-structuredcontent-body branch June 11, 2026 12:40
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.

1 participant