ADK.MCP.ToolAdapter (ADK v0.0.1-alpha.1)

Copy Markdown View Source

Converts MCP server tools into ADK FunctionTool structs.

Connect to an MCP server, list its tools, and get back ADK-compatible tools ready to pass to LlmAgent.

Examples

{:ok, client} = ADK.MCP.Client.start_link(command: "my-mcp-server")
{:ok, tools} = ADK.MCP.ToolAdapter.to_adk_tools(client)
# tools are FunctionTool structs — pass them to LlmAgent
agent = LlmAgent.new(name: "bot", model: "gpt-4", instruction: "Help", tools: tools)

Summary

Functions

Fetch tools from an MCP client and convert them to ADK FunctionTools.

Convert a single MCP tool definition to an ADK FunctionTool.

Functions

to_adk_tools(client)

@spec to_adk_tools(GenServer.server()) ::
  {:ok, [ADK.Tool.FunctionTool.t()]} | {:error, term()}

Fetch tools from an MCP client and convert them to ADK FunctionTools.

to_function_tool(client, tool)

@spec to_function_tool(GenServer.server(), map()) :: ADK.Tool.FunctionTool.t()

Convert a single MCP tool definition to an ADK FunctionTool.