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. 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 ${uri}-${method} or re_${uri}_${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 Array of content blocks returned by the tool. Each element has a type (e.g. text), the raw text, and a parsed field containing the text automatically parsed as JSON, if applicable.
isError Whether the tool call resulted in an error.

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://xxxx.developer.orkescloud.com/feedback-service/mcp",
    "method": "POST_user_feedback_user_id",
    "arguments": {
      "user-id": "test-user",
      "rating": 5,
      "comment": "Great service!"
    },
    "headers": {}
  },
  "type": "CALL_MCP_TOOL"
}