fix(web_fetch): include page body in structuredContent#14
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
structuredContentinstead of the text content blocks (e.g. Claude Cowork),web_fetchreturned only the metadata line{format, url, bytes}and the page body never reached the model.contenttext block, whilestructuredContentcarried metadata only. The MCP spec expects the two representations to be functionally equivalent — the other three tools already satisfy this, which is why onlyweb_fetchmisbehaved.structuredContent.body, matching the equivalence pattern of the other tools.test:liveverifyingstructuredContent.bodymatches the text content; version bump to 0.2.2 + changelog entry.Test plan
bodyinstructuredContent(watched them fail before the fix): 109/109 passbuild:mcpball cleannpm run test:livewith a real token: 8/8 PASS, including the new handler-level check🤖 Generated with Claude Code