Skip to content

fix: Resources now have "_meta"#61

Merged
jpmcb merged 1 commit intomainfrom
resource-meta
Jan 5, 2026
Merged

fix: Resources now have "_meta"#61
jpmcb merged 1 commit intomainfrom
resource-meta

Conversation

@jpmcb
Copy link
Contributor

@jpmcb jpmcb commented Jan 5, 2026

Exposes the _meta field for resources.

Signed-off-by: John McBride <john@zuplo.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the _meta field in the ResourceMetadata interface, enabling resources to include flexible metadata as defined in the MCP specification.

  • Adds _meta field to the ResourceMetadata interface
  • Demonstrates usage with an example resource including custom metadata

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/resources/types.ts Adds _meta field to ResourceMetadata interface to expose metadata capabilities
examples/servers/resources/src/index.ts Demonstrates usage by adding _meta field with example data to a resource

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mimeType?: string;
annotations?: Annotations;
size?: number;
_meta?: Resource["_meta"];
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a circular type reference. The ResourceMetadata interface is referencing Resource["_meta"], which itself is defined in the MCP schema as z.optional(z.object({}).loose()). Instead of referencing Resource["_meta"], this should directly define the type as Record<string, unknown> or use a similar type definition to match the schema's loose object type. This avoids the circular dependency and correctly represents the flexible metadata structure.

Suggested change
_meta?: Resource["_meta"];
_meta?: Record<string, unknown>;

Copilot uses AI. Check for mistakes.
@jpmcb jpmcb merged commit 1a51446 into main Jan 5, 2026
10 checks passed
@jpmcb jpmcb deleted the resource-meta branch January 5, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant