plexus.cli.procedure.mcp_tool module

MCP Tool wrapper for LangChain compatibility.

Provides a simple wrapper that makes MCP tools compatible with LangChain’s tool interface.

class plexus.cli.procedure.mcp_tool.MCPTool(*, name: str, description: str, args_schema: type | None = None, func: Callable[[Dict[str, Any]], str])

Bases: BaseModel

LangChain-compatible tool that wraps an MCP tool.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

args_schema: type | None
async arun(**kwargs) str

Async version of run.

description: str
func: Callable[[Dict[str, Any]], str]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str
run(**kwargs) str

Run the tool with the given arguments.