Build a simple MCP agent
An MCP agent loads tools, lets the model choose an action, runs the requested tool, and then rephrases the result.
Use a block’s tool connection
If the block selected from the palette offers an MCP tool connection, add an MCP - List tools block, configure its servers, and fetch the tools you need. Connect it through the Contextual ports section of the block that will use them.
The catalog stays outside the main path and is prepared before the consuming block runs. Fill in that block’s fields, connect its outputs, and test a request with and without a tool call. Follow the connection guide for detailed steps.
Build the loop one block at a time
The following path uses standard blocks to configure the instruction, model request, and tool calls explicitly.
The agent loop
MCP - List toolsproducestoolsandtoolServerRouting.LLM instructionprepares the context and business rules.LLM requestreceives{{listTools-1.tools}}and may producegenericToolCalls.Conditiontestsgt (length chatCompletion-1.genericToolCalls) 0.MCP - Call toolsconsumes the calls and routing.- The path returns to the same
LLM instruction, which includes the result from history, then to the LLM request. - If no tool is requested, the
contentanswer ends the turn directly.
Configure the catalog
For each MCP server, provide its name, URL, headers, and optional metadata. Click Get tools, then allow only the actions needed by the workflow.
{
"Authorization": "{{customParams.mcpAuthorization}}"
}Metadata is entered in Meta as key/value pairs, with Add Item:
| Key | Value |
|---|---|
userEmail | {{userData.email}} |
Organization, conversation, application, and execution identifiers, as well as userData, are sent automatically: do not redefine them in Meta.
Send tools to the model
In the LLM request:
Tools: {{listTools-1.tools}}
Strict mode: trueThe instruction should explain when to use a tool, when to answer directly, and which actions require confirmation.
Call the correct server
In MCP - Call tools:
Tool executions: {{chatCompletion-1.genericToolCalls}}
Routing server: {{listTools-1.toolServerRouting}}Routing maps each tool to the server that exposes it. Do not replace this reference with a hard-coded URL.
Rephrase the result
After execution, the model should receive the tool result and history to produce a user-facing answer instead of raw technical output.
Connect the tool-call success output to the LLM instruction used before the request. The request keeps reading {{generatePrompt-1.instruction}}, which is recalculated each time the loop runs.
Example instruction:
Answer the user clearly from the tool result.
Do not invent data that is absent from the result.
If the action failed, explain it without exposing technical details.With or without tools
| Without MCP | With MCP |
|---|---|
| The bot describes how to perform the action | The bot can perform the action |
| External data is not queried | The server provides current data |
| The response remains informational | The response becomes operational |
Security and reliability
- limit the catalog to required tools;
- pass tokens through
customParams, never as plain text in the workflow; - ask for user confirmation before sensitive actions;
- test token expiration and insufficient permissions;
- connect catalog, LLM, and tool-call errors;
- ensure the loop always has an exit route.