Skip to content

update _meta usage guidance in types.ts #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 33 additions & 21 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ export const RequestSchema = z.object({
const BaseNotificationParamsSchema = z
.object({
/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
.passthrough();
Expand All @@ -58,8 +59,9 @@ export const NotificationSchema = z.object({
export const ResultSchema = z
.object({
/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
.passthrough();
Expand Down Expand Up @@ -436,7 +438,8 @@ export const ResourceContentsSchema = z
*/
mimeType: z.optional(z.string()),
/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
Expand Down Expand Up @@ -478,8 +481,9 @@ export const ResourceSchema = BaseMetadataSchema.extend({
mimeType: z.optional(z.string()),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
});

Expand All @@ -505,8 +509,9 @@ export const ResourceTemplateSchema = BaseMetadataSchema.extend({
mimeType: z.optional(z.string()),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
});

Expand Down Expand Up @@ -642,7 +647,8 @@ export const PromptSchema = BaseMetadataSchema.extend({
*/
arguments: z.optional(z.array(PromptArgumentSchema)),
/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
});
Expand Down Expand Up @@ -690,8 +696,9 @@ export const TextContentSchema = z
text: z.string(),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
.passthrough();
Expand All @@ -712,8 +719,9 @@ export const ImageContentSchema = z
mimeType: z.string(),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
.passthrough();
Expand All @@ -734,8 +742,9 @@ export const AudioContentSchema = z
mimeType: z.string(),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
.passthrough();
Expand All @@ -748,7 +757,8 @@ export const EmbeddedResourceSchema = z
type: z.literal("resource"),
resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
Expand Down Expand Up @@ -895,8 +905,9 @@ export const ToolSchema = BaseMetadataSchema.extend({
annotations: z.optional(ToolAnnotationsSchema),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
});

Expand Down Expand Up @@ -1230,8 +1241,9 @@ export const RootSchema = z
name: z.optional(z.string()),

/**
* Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
*/
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
* for notes on _meta usage.
*/
_meta: z.optional(z.object({}).passthrough()),
})
.passthrough();
Expand Down