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

Tool name

Name of the MCP tool to invoke, as reported by the server. No default: this property is required.

URL of the MCP server

Streamable HTTP or SSE endpoint of the MCP server, matching the chosen transport. No default: this property is required.

Tool arguments

Arguments passed to the tool, matching the input schema the server advertises. Not set by default (no argument).

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Defaulttrue

Fail on tool error

If true, the task fails when the MCP server reports the tool call as an error. If false, the task succeeds and the failure is surfaced through the isError and errorMessage outputs instead. Defaults to true.

Custom headers

Extra HTTP headers sent with every request, typically to carry an authentication token via the Authorization header. Not set by default.

Defaultfalse

Log requests

If true, requests sent to the MCP server are logged at INFO level. Defaults to false.

Defaultfalse

Log responses

If true, responses received from the MCP server are logged at INFO level. Defaults to false.

Connection timeout duration

Maximum time to wait for a response from the MCP server. Not set by default, in which case the underlying MCP client's own default applies and this task enforces no timeout.

DefaultSTREAMABLE_HTTP
Possible Values
STREAMABLE_HTTPSSEUNKNOWN

Transport

Protocol used to reach the MCP server: STREAMABLE_HTTP or SSE. Defaults to STREAMABLE_HTTP.

Error message

Message describing why the tool call failed. Populated only when failOnToolError is false and the call failed.

Error flag

Whether the MCP server reported the tool call as an error. Only meaningful when failOnToolError is false, since the task fails otherwise.

Tool result

Text result returned by the tool.

Structured content

Structured payload returned by the tool, present only when the server provided one alongside the text result.

Unitcalls

Number of MCP tool calls, tagged by tool name