yera.tools.mcp.tool

MCP-backed Yera tool implementation.

Symbols

class MCPTool — A Yera tool backed by a remote MCP server.

MCPTool

Inherits: BaseTool

A Yera tool backed by a remote MCP server.

Methods

__repr__ — Return a concise representation of the imported MCP tool.
async_start — Start the MCP tool without waiting for server-created work.
start — Start the MCP tool synchronously without waiting for server-created work.
async_call — Validate arguments and invoke the MCP tool asynchronously.
async_invoke — Fill this tool's inputs and invoke it asynchronously.
invoke — Fill this tool's inputs and invoke it synchronously.
__call__ — Validate arguments and invoke the remote MCP tool.

MCPTool.__repr__

__repr__() → str

Return a concise representation of the imported MCP tool.

MCPTool.async_start

async_start(
    *args,
    **kwargs,
) → MCPTask[object]

Start the MCP tool without waiting for server-created work.

Parameters

*args
type: object = ()

Positional values in imported schema-property order.

**kwargs
type: object

Named values matching the generated MCP input structure.

Returns

type: MCPTask[object]

A stable task handle for immediate or asynchronous execution.

MCPTool.start

start(
    *args,
    **kwargs,
) → MCPTask[object]

Start the MCP tool synchronously without waiting for server-created work.

Parameters

*args
type: object = ()

Positional values in imported schema-property order.

**kwargs
type: object

Named values matching the generated MCP input structure.

Returns

type: MCPTask[object]

A stable task handle for immediate or asynchronous execution.

MCPTool.async_call

async_call(
    *args,
    **kwargs,
) → object

Validate arguments and invoke the MCP tool asynchronously.

Parameters

*args
type: object = ()

Positional values in imported schema-property order.

**kwargs
type: object

Named values matching the generated MCP input structure.

Returns

type: object

The converted Python result.

Raises

TypeError

If the positional and keyword arguments cannot be bound.

ValueError

If the arguments do not satisfy the imported schema.

MCPToolCallError

If the remote server reports tool failure.

MCPTool.async_invoke

async_invoke(
    instruction: str | None = None,
    retry_on_mcp_error: bool = False,
    **kwargs,
) → object

Fill this tool's inputs and invoke it asynchronously.

Parameters

instruction
type: str | None = None

Optional instruction guiding input generation.

retry_on_mcp_error
type: bool = False

Whether to correct arguments and retry once after the MCP server rejects a call.

**kwargs
type: str | int | float | bool

Additional values passed to LLM generation.

Returns

type: object

The converted result returned by the MCP tool.

MCPTool.invoke

invoke(
    instruction: str | None = None,
    retry_on_mcp_error: bool = False,
    **kwargs,
) → object

Fill this tool's inputs and invoke it synchronously.

Parameters

instruction
type: str | None = None

Optional instruction guiding input generation.

retry_on_mcp_error
type: bool = False

Whether to correct arguments and retry once after the MCP server rejects a call.

**kwargs
type: str | int | float | bool

Additional values passed to LLM generation.

Returns

type: object

The converted result returned by the MCP tool.

MCPTool.__call__

__call__(
    *args,
    **kwargs,
) → object

Validate arguments and invoke the remote MCP tool.

Parameters

*args
type: object = ()

Positional values in imported schema-property order.

**kwargs
type: object

Named values matching the generated MCP input structure.

Returns

type: object

The converted Python result.

Raises

TypeError

If the positional and keyword arguments cannot be bound.

ValueError

If the arguments do not satisfy the imported schema.

MCPToolCallError

If the remote server reports tool failure.