feat: pass _meta through resources/read path#211
Merged
seuros merged 2 commits intoseuros:masterfrom Apr 15, 2026
Merged
Conversation
6f76dfb to
b0a3ab5
Compare
Resource, Content::Resource, resource_template#build_resource and the server resources handler now preserve _meta from template resolve through to the wire response. closes a pre-existing spec gap: the ext-apps schema.json defines _meta on Resource, TextResourceContents and BlobResourceContents, but the gem was dropping it. Inner _meta is emitted on the inner resource hash, not the outer content envelope, matching apps.mdx:233-259 (TextResourceContents / BlobResourceContents definitions). Validation: ArgumentError if _meta is passed as a non-Hash. Empty hash is treated the same as nil (not emitted).
b0a3ab5 to
b759280
Compare
seuros
requested changes
Apr 15, 2026
the Ruby kwarg and attr_reader are `meta` now, wire output is still `_meta`. `_` prefix in Ruby means unused, which was misleading. also duck-type the input: respond_to?(:to_hash) first, then :to_h, otherwise ArgumentError. scoped to Resource, Content::Resource, and ResourceTemplate#build_resource so this PR stays narrow.
crisnahine
added a commit
to crisnahine/action_mcp
that referenced
this pull request
Apr 16, 2026
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.
Fixes a pre-existing spec gap.
ext-apps/src/generated/schema.jsondefines_metaonResource,TextResourceContents, andBlobResourceContents, but action_mcp was dropping it on theresources/readpath.changes
Resourceaccepts_meta:kwarg, emits it onto_h, includes it in==andhashContent::Resourceaccepts_meta:kwarg, emits it on the innerresource:hash (matchesTextResourceContents/BlobResourceContentsshape, not the outer{type, resource}envelope)normalize_read_contentinserver/resources.rbpasses_metathrough on the inner contentsResourceTemplate#build_resourceaccepts and forwards_meta:ResourceandContent::ResourceraiseArgumentErroron non-Hash_metatests
_metaassertions folded into existing tests inresource_test.rb,content_test.rb, andresource_template_test.rbMetaEchoTemplateadded to the dummy app;server/resources_test.rbuses it to drive a realsend_resource_readcall and assert the wire shapescope
spec-gap fix only. no MCP Apps vocabulary. the MCP Apps support (#202) builds on top in a follow-up PR.