# MCP

> Call a tool on any MCP server.

Built-in step · 1 step. Web page: https://docs.lodol.com/docs/integrations/built-in/mcp

## Steps

### Call an MCP tool

Call a tool on any MCP server, the way an AI assistant does. Give the server's URL, the tool's name and its arguments, and what the tool answers comes back ready for later steps to read. Store an access token as a workspace secret and reference it in a header to call a server that needs one.

**Inputs**

- Server URL (`server_url`, text, required): The server's MCP address, usually ending in /mcp, for example https://mcp.example.com/mcp. It can be built from workspace values.
- Tool (`tool`, text, required): The name of the tool to call, as the server lists it, for example search_documents.
- Arguments (`arguments`, object): What to pass to the tool, one row per argument the tool takes. A value can be text, a number, or a reference to a value from an earlier step, including a whole object or list.
- Headers (`headers`, object): Headers to send with every request, such as an Authorization header. Use a workspace secret for a token so it is never stored in the workflow.
- Tool errors (`on_error`, text): What it means when the tool answers with an error of its own, such as nothing found or a bad argument. Treating it as a result lets later steps check ok themselves. A server that can't be reached or refuses the call still fails the step; the step's own "If this step fails" setting decides what happens then. One of: `fail` (Fail the step), `continue` (Treat them as results). Default: `fail`.

**Outputs**

- `content` (list): The answer's parts as the server sent them
- `documents` (list): Images, audio and files the tool returned
- `ok` (true/false): False when the tool answered with an error of its own
- `output` (object): The tool's structured result, or the JSON its answer holds, or else its answer as text
- `server` (object): The server's name and version
- `text` (text): Every text part of the answer, joined
- `tool` (text): The tool's name

**Example output**

```json
{
  "content": [],
  "documents": [],
  "ok": true,
  "output": {},
  "server": {
    "name": "example_value",
    "version": "example_value"
  },
  "text": "example_value",
  "tool": "example_value"
}
```
