Skip to content

Call MCP Tool

The Call MCP Tool task invokes a specific tool exposed by an MCP (Model Context Protocol) server and returns its result. Use it to execute a tool discovered via List MCP Tools; for example, calling an API-backed tool with arguments derived from an LLM's output.

Task parameters

Configure these parameters for the Call MCP Tool task.

Parameter Description Required/ Optional
inputParameters.mcpServer The URL of the MCP server hosting the tool. Must be an HTTP or HTTPS URL. Required.
inputParameters.method The name of the tool to call. Required.
inputParameters.arguments A map of arguments to pass to the tool, matching its input schema. Optional.
inputParameters.headers A map of HTTP headers to send with the request, such as authentication headers required by the MCP server. Optional.

The following are generic configuration parameters that can be applied to the task and are not specific to the Call MCP Tool task.

Caching parameters

You can cache the task outputs using the following parameters. Refer to Caching Task Outputs for a full guide.

Parameter Description Required/ Optional
cacheConfig.ttlInSecond The time to live in seconds, which is the duration for the output to be cached. Required if using cacheConfig.
cacheConfig.key The cache key is a unique identifier for the cached output and must be constructed exclusively from the task’s input parameters.
It can be a string concatenation that contains the task’s input keys, such as ${mcpServer}-${method} or re_${mcpServer}_${method}.
Required if using cacheConfig.
Other generic parameters

Here are other parameters for configuring the task behavior.

Parameter Description Required/ Optional
optional Whether the task is optional.

If set to true, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding.
Optional.

Task configuration

This is the task configuration for a Call MCP Tool task.

{
  "name": "call_mcp_tool",
  "taskReferenceName": "call_mcp_tool_ref",
  "inputParameters": {
    "mcpServer": "<YOUR-MCP-SERVER-URL>",
    "method": "<TOOL-NAME>",
    "arguments": {}
  },
  "type": "CALL_MCP_TOOL"
}

Task output

The Call MCP Tool task will return the following parameters.

Parameter Description
content The content items returned by the tool.
content.type The type of the content item, such as text.
content.text The raw text returned by the tool.
content.data The data returned by the tool, for content that is not text.
content.mimeType The MIME type of the content item, if provided.
content.parsed The text parsed as JSON. If the text is not valid JSON, this is the same as the text.
isError Whether the tool reported an error. The task still completes when this is true, so check this value in your workflow.

Examples

Here are some examples for using the Call MCP Tool task.

Using a Call MCP Tool task in a workflow
{
  "name": "call_mcp_tool",
  "taskReferenceName": "call_mcp_tool_ref",
  "inputParameters": {
    "mcpServer": "https://mcp.deepwiki.com/mcp",
    "method": "read_wiki_structure",
    "arguments": {
      "repoName": "conductor-oss/conductor"
    },
    "headers": {}
  },
  "type": "CALL_MCP_TOOL"
}