AI CallTool

AI CallTool

Certified

Call a tool on an MCP server and return its result

Connects to a Model Context Protocol (MCP) server, invokes one of its tools with the given arguments, and returns the result — no LLM involved. Use io.kestra.plugin.ai.mcp.ListTools to discover the available tools and their argument schemas first.

yaml
type: io.kestra.plugin.ai.mcp.CallTool

Call the add tool on an MCP server over Streamable HTTP.

yaml
id: mcp_call_tool
namespace: company.ai

tasks:
  - id: call
    type: io.kestra.plugin.ai.mcp.CallTool
    url: https://mcp.example.com/mcp
    headers:
      Authorization: "Bearer {{ secret('MCP_API_TOKEN') }}"
    tool: add
    arguments:
      a: 5
      b: 12
Properties

Name of the tool to call

URL of the MCP server

The Streamable HTTP or SSE endpoint of the MCP server.

Arguments passed to the tool

Defaulttrue

Fail on tool error

Whether the task should fail when the MCP server reports the tool call as an error. When false, the error is instead reported in errorMessage and isError.

Custom headers

Useful, for example, for adding authentication tokens via the Authorization header.

Defaultfalse

Log requests

Defaultfalse

Log responses

Reference (ref) of the pluginDefaults to apply to this task.

Connection timeout duration

When not set, the underlying MCP client's default timeout applies (no timeout is enforced by this task).

DefaultSTREAMABLE_HTTP
Possible Values
STREAMABLE_HTTPSSEUNKNOWN

Transport used to connect to the MCP server

Error message

Populated only when failOnToolError is false and the call failed.

Whether the tool call returned an error

Tool result

The tool's text result.

Structured content

The tool's structured content, when the server returned one.

Unitcalls

Number of MCP tool calls, tagged by tool name