diff --git a/src/mcp/types.py b/src/mcp/types.py index 5bcf4514..6fc55103 100644 --- a/src/mcp/types.py +++ b/src/mcp/types.py @@ -939,7 +939,7 @@ class GetPromptRequest(Request[GetPromptRequestParams, Literal["prompts/get"]]): class TextContent(MCPModel): """Text content for a message.""" - type: Literal["text"] + type: Literal["text"] = "text" text: str """The text content of the message.""" annotations: Annotations | None = None @@ -953,7 +953,7 @@ class TextContent(MCPModel): class ImageContent(MCPModel): """Image content for a message.""" - type: Literal["image"] + type: Literal["image"] = "image" data: str """The base64-encoded image data.""" mimeType: str @@ -972,7 +972,7 @@ class ImageContent(MCPModel): class AudioContent(MCPModel): """Audio content for a message.""" - type: Literal["audio"] + type: Literal["audio"] = "audio" data: str """The base64-encoded audio data.""" mimeType: str @@ -997,7 +997,7 @@ class ToolUseContent(MCPModel): in the next user message. """ - type: Literal["tool_use"] + type: Literal["tool_use"] = "tool_use" """Discriminator for tool use content.""" name: str @@ -1024,7 +1024,7 @@ class ToolResultContent(MCPModel): from the assistant. It contains the output of executing the requested tool. """ - type: Literal["tool_result"] + type: Literal["tool_result"] = "tool_result" """Discriminator for tool result content.""" toolUseId: str @@ -1089,7 +1089,7 @@ class EmbeddedResource(MCPModel): of the LLM and/or the user. """ - type: Literal["resource"] + type: Literal["resource"] = "resource" resource: TextResourceContents | BlobResourceContents annotations: Annotations | None = None meta: dict[str, Any] | None = Field(alias="_meta", default=None) @@ -1106,7 +1106,7 @@ class ResourceLink(Resource): Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests. """ - type: Literal["resource_link"] + type: Literal["resource_link"] = "resource_link" ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource @@ -1480,7 +1480,7 @@ class CreateMessageResultWithTools(Result): class ResourceTemplateReference(MCPModel): """A reference to a resource or resource template definition.""" - type: Literal["ref/resource"] + type: Literal["ref/resource"] = "ref/resource" uri: str """The URI or URI template of the resource.""" @@ -1488,7 +1488,7 @@ class ResourceTemplateReference(MCPModel): class PromptReference(MCPModel): """Identifies a prompt.""" - type: Literal["ref/prompt"] + type: Literal["ref/prompt"] = "ref/prompt" name: str """The name of the prompt or prompt template"""