Xingyao Wang c2f46200c0
chore(lint): Apply comprehensive linting and formatting fixes (#10287)
Co-authored-by: openhands <openhands@all-hands.dev>
2025-08-13 21:13:19 +02:00

24 lines
692 B
Python

from mcp.types import Tool
from pydantic import ConfigDict
class MCPClientTool(Tool):
"""Represents a tool proxy that can be called on the MCP server from the client side.
This version doesn't store a session reference, as sessions are created on-demand
by the MCPClient for each operation.
"""
model_config = ConfigDict(arbitrary_types_allowed=True)
def to_param(self) -> dict:
"""Convert tool to function call format."""
return {
'type': 'function',
'function': {
'name': self.name,
'description': self.description,
'parameters': self.inputSchema,
},
}