Skip to content

Commit 0cfe249

Browse files
author
shiraayal-tadata
committed
fix pydantic error in cursor using mcp
1 parent 12dc720 commit 0cfe249

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fastapi_mcp/http_tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from fastapi import FastAPI
1313
from fastapi.openapi.utils import get_openapi
1414
from mcp.server.fastmcp import FastMCP
15+
from pydantic import Field
1516

1617
logger = logging.getLogger("fastapi_mcp")
1718

@@ -435,7 +436,7 @@ def create_http_tool(
435436
required_props.append(param_name)
436437

437438
# Function to dynamically call the API endpoint
438-
async def http_tool_function(**kwargs):
439+
async def http_tool_function(kwargs: Dict[str, Any] = Field(default_factory=dict)):
439440
# Prepare URL with path parameters
440441
url = f"{base_url}{path}"
441442
for param_name, _ in path_params:

0 commit comments

Comments
 (0)