
AI CallTool
CertifiedCall a tool on an MCP server and return its result
AI CallTool
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.
type: io.kestra.plugin.ai.mcp.CallToolExamples
Call the add tool on an MCP server over Streamable HTTP.
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
tool *Requiredstring
Name of the tool to call
url *Requiredstring
URL of the MCP server
The Streamable HTTP or SSE endpoint of the MCP server.
arguments object
Arguments passed to the tool
failOnToolError booleanstring
trueFail 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.
headers object
Custom headers
Useful, for example, for adding authentication tokens via the Authorization header.
logRequests booleanstring
falseLog requests
logResponses booleanstring
falseLog responses
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
timeout string
Connection timeout duration
When not set, the underlying MCP client's default timeout applies (no timeout is enforced by this task).
transport string
STREAMABLE_HTTPSTREAMABLE_HTTPSSEUNKNOWNTransport used to connect to the MCP server
Outputs
errorMessage string
Error message
Populated only when failOnToolError is false and the call failed.
isError boolean
Whether the tool call returned an error
result string
Tool result
The tool's text result.
structuredContent object
Structured content
The tool's structured content, when the server returned one.
Metrics
mcp.tool.calls counter
callsNumber of MCP tool calls, tagged by tool name