Skip to content

Commit 3df7325

Browse files
Add missing _meta fields to match spec requirements
Added optional _meta field to ResourceContentsSchema, PromptSchema, and EmbeddedResourceSchema to align with spec change PR #710. These were the only schemas missing the _meta field that were required by the specification update. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent e89137f commit 3df7325

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ export const ResourceContentsSchema = z
435435
* The MIME type of this resource, if known.
436436
*/
437437
mimeType: z.optional(z.string()),
438+
/**
439+
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
440+
*/
441+
_meta: z.optional(z.object({}).passthrough()),
438442
})
439443
.passthrough();
440444

@@ -637,6 +641,10 @@ export const PromptSchema = BaseMetadataSchema.extend({
637641
* A list of arguments to use for templating the prompt.
638642
*/
639643
arguments: z.optional(z.array(PromptArgumentSchema)),
644+
/**
645+
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
646+
*/
647+
_meta: z.optional(z.object({}).passthrough()),
640648
});
641649

642650
/**
@@ -739,6 +747,10 @@ export const EmbeddedResourceSchema = z
739747
.object({
740748
type: z.literal("resource"),
741749
resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
750+
/**
751+
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
752+
*/
753+
_meta: z.optional(z.object({}).passthrough()),
742754
})
743755
.passthrough();
744756

0 commit comments

Comments
 (0)