Skip to content

Commit fdcdfde

Browse files
feat: add _meta to more objects
1 parent f3cd20c commit fdcdfde

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

src/mcp/types.py

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ class Meta(BaseModel):
6969

7070
meta: Meta | None = Field(alias="_meta", default=None)
7171
"""
72-
This parameter name is reserved by MCP to allow clients and servers to attach
73-
additional metadata to their notifications.
72+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
7473
"""
7574

7675

@@ -109,8 +108,7 @@ class Result(BaseModel):
109108

110109
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
111110
"""
112-
This result property is reserved by the protocol to allow clients and servers to
113-
attach additional metadata to their responses.
111+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
114112
"""
115113

116114

@@ -395,6 +393,10 @@ class Resource(BaseModel):
395393
"""
396394
annotations: Annotations | None = None
397395
model_config = ConfigDict(extra="allow")
396+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
397+
"""
398+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
399+
"""
398400

399401

400402
class ResourceTemplate(BaseModel):
@@ -416,6 +418,10 @@ class ResourceTemplate(BaseModel):
416418
"""
417419
annotations: Annotations | None = None
418420
model_config = ConfigDict(extra="allow")
421+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
422+
"""
423+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
424+
"""
419425

420426

421427
class ListResourcesResult(PaginatedResult):
@@ -622,6 +628,10 @@ class TextContent(BaseModel):
622628
"""The text content of the message."""
623629
annotations: Annotations | None = None
624630
model_config = ConfigDict(extra="allow")
631+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
632+
"""
633+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
634+
"""
625635

626636

627637
class ImageContent(BaseModel):
@@ -637,6 +647,10 @@ class ImageContent(BaseModel):
637647
"""
638648
annotations: Annotations | None = None
639649
model_config = ConfigDict(extra="allow")
650+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
651+
"""
652+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
653+
"""
640654

641655

642656
class AudioContent(BaseModel):
@@ -652,6 +666,10 @@ class AudioContent(BaseModel):
652666
"""
653667
annotations: Annotations | None = None
654668
model_config = ConfigDict(extra="allow")
669+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
670+
"""
671+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
672+
"""
655673

656674

657675
class SamplingMessage(BaseModel):
@@ -773,6 +791,10 @@ class Tool(BaseModel):
773791
annotations: ToolAnnotations | None = None
774792
"""Optional additional tool information."""
775793
model_config = ConfigDict(extra="allow")
794+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
795+
"""
796+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
797+
"""
776798

777799

778800
class ListToolsResult(PaginatedResult):
@@ -1065,6 +1087,10 @@ class Root(BaseModel):
10651087
referencing the root in other parts of the application.
10661088
"""
10671089
model_config = ConfigDict(extra="allow")
1090+
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
1091+
"""
1092+
Reserved by MCP for protocol-level metadata; implementations must not make assumptions about its contents.
1093+
"""
10681094

10691095

10701096
class ListRootsResult(Result):

0 commit comments

Comments
 (0)