nat.plugins.mcp.tool#
Attributes#
Classes#
Function which connects to a Model Context Protocol (MCP) server and wraps the selected tool as a NeMo Agent toolkit |
Functions#
|
Create a NeMo Agent toolkit function from an MCP tool. |
|
Generate a NeMo Agent Toolkit Function that wraps a tool provided by the MCP server. |
Module Contents#
- logger#
- class MCPToolConfig(/, **data: Any)#
Bases:
nat.data_models.function.FunctionBaseConfigFunction which connects to a Model Context Protocol (MCP) server and wraps the selected tool as a NeMo Agent toolkit 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.selfis explicitly positional-only to allowselfas a field name.- transport: Literal['sse', 'stdio', 'streamable-http'] = None#
- validate_model()#
Validate that stdio and SSE/Streamable HTTP properties are mutually exclusive.
- mcp_tool_function( ) nat.builder.function_info.FunctionInfo#
Create a NeMo Agent toolkit function from an MCP tool.
- Args:
tool: The MCP tool to wrap
- Returns:
The NeMo Agent toolkit function
- async mcp_tool(config: MCPToolConfig, builder: nat.builder.builder.Builder)#
Generate a NeMo Agent Toolkit Function that wraps a tool provided by the MCP server.