Skip to content

Commit ea7ddd6

Browse files
author
chenzailong
committed
Add DictContext to mcp.type.ContentBlock
1 parent 6cd9551 commit ea7ddd6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/mcp/types.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,12 @@ class AudioContent(BaseModel):
714714
model_config = ConfigDict(extra="allow")
715715

716716

717-
class JsonContent(BaseModel):
718-
"""Json content for a message."""
717+
class DictContent(BaseModel):
718+
"""Dict content for a message."""
719719

720-
type: Literal["json"]
720+
type: Literal["dict"]
721721
data: dict[str, Any]
722-
"""The json content of the message."""
722+
"""The dict content of the message."""
723723
annotations: Annotations | None = None
724724
meta: dict[str, Any] | None = Field(alias="_meta", default=None)
725725
"""
@@ -733,7 +733,7 @@ class SamplingMessage(BaseModel):
733733
"""Describes a message issued to or received from an LLM API."""
734734

735735
role: Role
736-
content: TextContent | ImageContent | AudioContent | JsonContent
736+
content: TextContent | ImageContent | AudioContent | DictContent
737737
model_config = ConfigDict(extra="allow")
738738

739739

@@ -766,7 +766,7 @@ class ResourceLink(Resource):
766766
type: Literal["resource_link"]
767767

768768

769-
ContentBlock = TextContent | ImageContent | AudioContent | JsonContent | ResourceLink | EmbeddedResource
769+
ContentBlock = TextContent | ImageContent | AudioContent | DictContent | ResourceLink | EmbeddedResource
770770
"""A content block that can be used in prompts and tool results."""
771771

772772
Content: TypeAlias = ContentBlock
@@ -1059,7 +1059,7 @@ class CreateMessageResult(Result):
10591059
"""The client's response to a sampling/create_message request from the server."""
10601060

10611061
role: Role
1062-
content: TextContent | ImageContent | AudioContent | JsonContent
1062+
content: TextContent | ImageContent | AudioContent | DictContent
10631063
model: str
10641064
"""The name of the model that generated the message."""
10651065
stopReason: StopReason | None = None

0 commit comments

Comments
 (0)