Skip to content

Commit 61ef3c9

Browse files
authored
Merge pull request #636 from modelcontextprotocol/fweinberger/addtl-meta
Add missing _meta fields to match spec requirements
2 parents e89137f + 3df7325 commit 61ef3c9

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)