MCP server
Every workspace has an MCP server through which an AI assistant runs the automations offered to it as tools, and, in Build mode, builds automations. This page is for developers connecting an AI client; what the server is for, and how an automation is offered on it, is on Results and MCP tools. Unlike the rest of the Reference, this page is written by hand.
Addresses
The server has two modes, chosen by the address an assistant connects to, each at a workspace's own address or at a root that covers every workspace the person may use. The Settings page's MCP Server tab shows the address for a chosen purpose and reach, with what to paste into Claude, ChatGPT, Claude Code and Gemini.
| Mode | Use it for | This workspace | Every workspace |
|---|---|---|---|
| Run | An assistant acting as a person: it sees the workspace's offered automations as tools. | /automation/mcp/<workspace code> | /automation/mcp |
| Build | An assistant building automations: it sees the tools to read, check, test, change and publish them, and none of the automations themselves. | /automation/manage/mcp/<workspace code> | /automation/manage/mcp |
The server names itself esca-<code>, esca, esca-build-<code> or esca-build. On a root server a tool's name is prefixed with its workspace's code, such as wdrt_summarize_article, and its title and description name the workspace, since tool names are unique only within a workspace. Run mode needs the Run capability, Build mode Build; the tools for answering need Approve, and get_settings needs Configure, as the pages do. A capability's tools are hidden from a person who lacks it.
A workspace refuses every assistant (403) until an Admin or Owner turns on Allow AI Agents to Connect on the Settings page, and is left out of the root servers while that is off. An assistant connects with OAuth, consenting as a person, and acts as that person from then on. A token is bound to the address it was issued for, so one for a workspace's server is no good at another's or at the root.
Calling an automation
A tool's inputs are its trigger's Custom Shape fields, with their descriptions. Arguments are checked against the shape before anything runs, and an argument the shape doesn't declare is refused rather than ignored.
A call starts the run and answers as soon as it has started, or, when the tool's Wait For Completion is on, waits up to 10 seconds for it. Only a few calls may wait at once, server-wide; the rest answer at once as if the setting were off, so assistants never hold the server's request threads. The answer carries:
| Field | What it says |
|---|---|
status | completed, working, input_required, failed or cancelled. |
result | The Result the run answered with, once it has completed, when the automation declares one. Values are redacted the way the run view redacts them, so a secret the run saw never leaves. |
prompt | What the run is waiting on, when status is input_required. |
stepId | The step that is waiting, as get_run_steps names it. A run whose parallel branches each wait on a person is paused on several steps; the answer describes the one paused longest, and an answer names the step it is for. |
requestId | The request the step is waiting on, when answerWith is present. The answering tool takes it back, so an answer goes to the request the person was shown: if the step was answered elsewhere and has asked something else since, the answer is refused rather than given to the new request. |
answerWith | When status is input_required and an assistant may relay the person's answer: answer_approval for an Approval or an AI Agent step's change held for approval, answer_run for anything else. Absent when a person has to answer in the tool. |
answerSchema | The JSON Schema of the answer answer_run takes, when answerWith is present. For a held change it carries the step's account of the change under x-brightspot-context and the call it would make, with its arguments, under x-brightspot-tool-call. |
error | Why the run failed or was cancelled. |
run | The run's id, its number in the automation's history, where a person can open it, whether it was a dry run, and, while it is working, checkBackInSeconds, drawn from how long the automation's recent runs spent working. |
A run that is still working or paused isn't over: read it back with get_run after checkBackInSeconds, until status is one of the three that end a run.
Tools in both modes
| Tool | What it does |
|---|---|
get_run | Reads a run back by the id in its handle. Finds only runs the calling person started in a workspace the server serves. |
list_runs | Lists the runs the person started through the server, newest first, each with its status, handle and tool; narrows by status, tool, automation and start time; pages back with before; with paths, lists those parts of each run's trigger output beside it. In Build mode it sees every run of the workspaces the person may build in. |
cancel_run | Stops a run that is still going, as the run page's Stop does. |
get_run_steps | Every step of a run in the order it started, then those that never did, each with its node, status, timing, iteration (its index in each loop, from 0) and error. |
get_run_step | One step in full: its resolved inputs, outputs and payload, earlier attempts, and its timeline of status changes and log lines. With no step named, the trigger's step; with paths, only those parts of the payload, such as contentValues/title. |
answer_approval | Relays the person's decision on an Approval, or on an AI Agent step's held change: approve or reject, with a comment where the approval requires one, recorded as that person's answer via an AI agent. Needs Approve. An Approval with People Only on refuses it. A run paused on more than one step needs stepId. Takes the requestId the run answered with; an answer to a request the step has since moved past is refused, and the assistant is told to read the run again. |
answer_run | Relays an answer to anything else a run is paused on, an agent's question or a form, in the shape answerSchema describes, held to it exactly as the form would be. It answers approvals too, in their own terms. Takes requestId the same way. Needs Approve. |
list_pending_approvals | Every run waiting on a person, in the workspaces the server serves, where the person may answer: the Approvals page, for an assistant. Each carries its question, requestId, answerWith and answerSchema. Needs Approve. |
preview_automation | A picture of the automation's flow as the editor draws it, in the light or dark theme. With a run's id it draws that run as the run view shows it: each step in its status's color, skipped steps dashed and faded, a step waiting on a person ringed, and the edges the run crossed. In Run mode it draws the offered automations, by id or tool name; in Build mode any automation the person may build. The same picture is served to a person at /automation/api/flow-image?automationId=…, with executionId, theme and scale. |
Tools in Build mode
Build mode offers a person who holds Build the tools to create an automation, try it and publish it in one connection. The tools follow capabilities the way the pages do: someone without Approve or Turn On / Off doesn't see those tools. The areas a role hides, such as Connections or Executions, aren't checked, so a builder whose role hides a page can still read what it shows through the matching tool.
Reading
| Tool | What it does |
|---|---|
list_workspaces | The workspaces the server serves, by the code the other tools take as workspace, with what the person may do in each. On the root server a build tool needs that code when the person may build in more than one workspace. |
list_automations, get_automation | What is there. get_automation returns the automation's document, the same export the UI produces and imports, with its validation and the version a write names. |
get_guide | The guide to building automations every building assistant reads: how automations work and how data passes between steps, with a topic each on the flow, variables, mappings, loops, results, scripts and the document format. |
describe_node_types | The node catalog: every node type the picker offers, by category, with its typename (a node's _type in a document) and what it is for. |
describe_node_type | One node type in full: typename, category, purpose, its fields as a JSON Schema with embedded types under $defs, each field's choices with their labels, and the outputs its edges leave by. fields narrows it. Types nested too deep are named under unexpandedTypes, for describe_type. |
describe_type | Any other type a document holds, by typename: the automation's definition, an edge, a note, a mapping and its transforms, or a type a schema names with $ref. One level at a time. |
get_field_values | What one field of a saved automation may hold, as the editor offers it: the variables it may bind, each as the {"$variable": …} object a document writes, and the choices its dropdown offers, such as connections or saved scripts. |
list_templates, get_template | The built-in templates and the workspace's saved ones, and one as a document. create_automation takes a template's key to start from it. |
list_connections, list_models, list_variables, list_content_types, get_settings | The workspace's connections and MCP servers by id, type and state, never a credential; the models each AI provider connection offers right now; variables with their values and secrets by name only; the content types, one in full as a JSON Schema, or with connection, a connected CMS's; and the settings and limits, with any limit the workspace is at. get_settings needs Configure. |
list_versions | Each saved version, newest first. |
list_deliveries | What the automation's triggers received, newest first, each with its origin, signature check and outcome, and the run it started; or one delivery in full with its body. Headers, which carry what the sender authenticated with, are never returned. |
get_stats | A workspace's runs, success rate, execution time, tokens, how many of those tokens went to Esca and how many to automation runs, and prompt-cache hit rate over a window against the window before, or one automation's runs by status. |
Checking and testing
| Tool | What it does |
|---|---|
validate_automation | Checks a document without saving it: what blocks a run or a publish, what the editor warns about, what an import review would ask a person to look at, and, node by node, what a save would refuse and the references that no longer resolve. For an automation that has run, unseenPaths names each path into the trigger's output that a step reads and none of the trigger's last 10 events held. |
test_automation | Runs an automation the person may build as a dry run, always; the answer says dryRun. It is the only way to run anything from Build mode. Its payload is the trigger's output, in the shape references into the trigger read; with replayRunId it runs the event a past run received instead. Refused when the trigger's Fire Condition would hold the event back. Names under emptyReferences each path into the trigger's output that a step reads and the payload leaves empty. Answers as soon as the run has started; read it back with get_run. |
check_script | Parses code in the sandbox a Script step runs it in and says what is wrong with it, without running it. |
Changing
| Tool | What it does |
|---|---|
create_automation | Makes a draft, off, from a document, through the same import the UI runs, so the review's findings come back as data, or a blank one from a name. |
update_automation | Replaces an automation's working copy from its document, or applies changes that add, change or remove a step or an edge and leave the rest. A draft changes in place; a published automation gets a revision, and the live one runs unchanged until publish_automation puts the revision over it. Nodes keep their ids; a new node gets one, and the answer says where each landed. Requires the version it read, so nobody's change is overwritten; a revision is read by its own id, and its liveNodeIds gives the live step each of its steps came from. A step saved without a position is placed as the editor places one, and the tool can lay the whole flow out again as Harmonize does. A Path Extraction whose path is set or changed takes the shape of the value at that path in the step's last successful run. |
take_shape | Takes a shape from a run the assistant names, for a Path Extraction or a Script's output, as the editor's run pickers do. Requires the version it read. |
publish_automation | The editor's Publish: a draft goes live and turns on, unless the workspace is at its limit of automations that are on; a revision goes over its live automation. An automation that couldn't run is refused. |
set_automation_enabled | The on/off switch. Needs Turn On / Off. |
archive_automation, restore_automation | What the Automations page does. |
discard_revision | Throws a revision away and leaves the live automation untouched. |
restore_version | A rollback that becomes a new version and keeps a trigger's identity as senders know it. |
export_automations | The export the Automations page produces, for several automations together with the references between them. |
list_agents, create_agent, update_agent, archive_agent, restore_agent | The Agents page: each agent in full, with its model, instructions and tool sources, and the fields to make or change one. An agent is archived rather than deleted; a step that runs an archived agent fails until it is restored. |
list_scripts, get_script, create_script, update_script, archive_script, restore_script | The Scripts page. An archived script is no longer offered, but a step that runs it still runs it. |
set_variable, delete_variable | The Variables page, for variables only. Secrets are set by a person in the tool, never through an assistant, so a value never sits in its transcript. |