mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
fix(curl): accept json parameter in MCP tool registration
Field(alias="json") doesn't translate to Python kwargs — FastMCP passes the schema name directly. Rename json_body to json in the registered function signature.
This commit is contained in:
@@ -161,9 +161,9 @@ Returns formatted response with status, headers (if verbose), and body.
|
||||
async def curl(
|
||||
url: Annotated[str, Field(description="Request URL")],
|
||||
method: Method = "GET",
|
||||
json_body: Annotated[
|
||||
json: Annotated[
|
||||
Optional[str],
|
||||
Field(description="JSON body (will be properly escaped)", alias="json"),
|
||||
Field(description="JSON body (will be properly escaped)"),
|
||||
] = None,
|
||||
data: Annotated[Optional[str], Field(description="Raw body data")] = None,
|
||||
headers: Annotated[
|
||||
@@ -187,7 +187,7 @@ Returns formatted response with status, headers (if verbose), and body.
|
||||
ctx,
|
||||
url=url,
|
||||
method=method,
|
||||
json_body=json_body,
|
||||
json_body=json,
|
||||
data=data,
|
||||
headers=headers,
|
||||
timeout=timeout,
|
||||
|
||||
Reference in New Issue
Block a user