Skip to content

Commit 94fd9c1

Browse files
refactor(runtime): align tool registration with FastMCP 3.x FunctionTool API
1 parent 9e70a06 commit 94fd9c1

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "allbemcp"
7-
version = "2.0.0"
7+
version = "2.0.1"
88
description = "Turn any Python library into an MCP Server"
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/allbemcp/runtime/server.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import mcp.types as types
2222
from fastmcp import Context, FastMCP
23+
from fastmcp.tools.function_tool import FunctionTool
2324

2425
try:
2526
from allbemcp.serialization.engine import SerializationConfig, SmartSerializer
@@ -118,11 +119,12 @@ async def wrapper(ctx: Context, _tool_name: str = tool_name, **kwargs: Any):
118119
]
119120

120121
self.mcp.add_tool(
121-
wrapper,
122-
name=tool_name,
123-
description=description,
124-
input_schema=input_schema,
125-
version="1.0",
122+
FunctionTool(
123+
fn=wrapper,
124+
name=tool_name,
125+
description=description,
126+
parameters=input_schema,
127+
)
126128
)
127129

128130
def _register_special_tools(self) -> None:

0 commit comments

Comments
 (0)