From 5b4f452596aa4e9318d43c66042850a38c1aef5f Mon Sep 17 00:00:00 2001 From: Artur Zdolinski Date: Thu, 26 Dec 2024 10:49:25 +0100 Subject: [PATCH 1/2] Update types.py propose for fix: mcp.types.Tool is not following python's naming convention #97 --- src/mcp/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mcp/types.py b/src/mcp/types.py index 2c27f83..21ea45c 100644 --- a/src/mcp/types.py +++ b/src/mcp/types.py @@ -1,6 +1,6 @@ from typing import Any, Generic, Literal, TypeVar -from pydantic import BaseModel, ConfigDict, Field, FileUrl, RootModel +from pydantic import BaseModel, ConfigDict, Field, FileUrl, RootModel, Field from pydantic.networks import AnyUrl """ @@ -657,7 +657,7 @@ class Tool(BaseModel): """The name of the tool.""" description: str | None = None """A human-readable description of the tool.""" - inputSchema: dict[str, Any] + input_schema: dict[str, Any] = Field(..., alias='inputSchema') """A JSON Schema object defining the expected parameters for the tool.""" model_config = ConfigDict(extra="allow") From 12a05df9c51ac65d1e0b9706cc8b34d700eecab0 Mon Sep 17 00:00:00 2001 From: Artur Zdolinski Date: Thu, 26 Dec 2024 11:08:05 +0100 Subject: [PATCH 2/2] Update types.py remove Field as it is 2x --- src/mcp/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcp/types.py b/src/mcp/types.py index 21ea45c..ad141d4 100644 --- a/src/mcp/types.py +++ b/src/mcp/types.py @@ -1,6 +1,6 @@ from typing import Any, Generic, Literal, TypeVar -from pydantic import BaseModel, ConfigDict, Field, FileUrl, RootModel, Field +from pydantic import BaseModel, ConfigDict, Field, FileUrl, RootModel from pydantic.networks import AnyUrl """