aiq.tool.mcp.mcp_tool#

Attributes#

Classes#

MCPToolConfig

Function which connects to a Model Context Protocol (MCP) server and wraps the selected tool as an AgentIQ function.

Functions#

mcp_tool(config, builder)

Generate an AgentIQ Function that wraps a tool provided by the MCP server.

Module Contents#

logger#
class MCPToolConfig(/, **data: Any)#

Bases: aiq.data_models.function.FunctionBaseConfig

Function which connects to a Model Context Protocol (MCP) server and wraps the selected tool as an AgentIQ function.

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.

url: pydantic.HttpUrl = None#
mcp_tool_name: str = None#
description: str | None = None#
async mcp_tool(config: MCPToolConfig, builder: aiq.builder.builder.Builder)#

Generate an AgentIQ Function that wraps a tool provided by the MCP server.