update
This commit is contained in:
@@ -12,9 +12,16 @@ class MCPTool(BaseModel):
|
||||
|
||||
name: str = Field(..., description="Unique tool identifier")
|
||||
description: str = Field(..., description="Human-readable tool description")
|
||||
input_schema: dict[str, Any] = Field(..., description="JSON schema describing input arguments")
|
||||
input_schema: dict[str, Any] = Field(
|
||||
...,
|
||||
alias="inputSchema",
|
||||
serialization_alias="inputSchema",
|
||||
description="JSON schema describing input arguments",
|
||||
)
|
||||
write_operation: bool = Field(default=False, description="Whether tool mutates data")
|
||||
|
||||
model_config = ConfigDict(populate_by_name=True)
|
||||
|
||||
|
||||
class MCPToolCallRequest(BaseModel):
|
||||
"""Request to invoke an MCP tool."""
|
||||
|
||||
@@ -328,7 +328,7 @@ async def automation_run_job(request: AutomationJobRequest) -> JSONResponse:
|
||||
async def list_tools() -> JSONResponse:
|
||||
"""List all available MCP tools."""
|
||||
response = MCPListToolsResponse(tools=AVAILABLE_TOOLS)
|
||||
return JSONResponse(content=response.model_dump())
|
||||
return JSONResponse(content=response.model_dump(by_alias=True))
|
||||
|
||||
|
||||
async def _execute_tool_call(
|
||||
@@ -519,7 +519,7 @@ async def sse_message_handler(request: Request) -> JSONResponse:
|
||||
content={
|
||||
"jsonrpc": "2.0",
|
||||
"id": message_id,
|
||||
"result": response.model_dump(),
|
||||
"result": response.model_dump(by_alias=True),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user