MCP tool
Goal
Call a tool on a saved MCP server and use its result. Time: 15 minutes. Needs: a saved MCP server (here Demo tools) with an echo tool that accepts {"message":"..."}.
Steps
- Add an MCP tool block. Choose the saved server, connect it, then choose the tool. Its parameters are copied onto the block.
- Supply
argumentsas a template that resolves to one JSON object. As with HTTP bodies, serialise it in code first.
What MCP publishes
status: ok, atextrepresentation of the result, and the top-level properties of the MCP result, such ascontentorstructuredContent.- JSON inside a
content[].textstring is not turned into workflow properties automatically. Parse it in a Code block. - If the arguments don’t resolve to a JSON object, the block fails with MCP arguments must resolve to a JSON object.
When a run starts, Termorq connects to the saved server automatically if it isn’t connected yet. If the block fails, open @logs to see whether the credential lookup or the connection failed.
Check your run
steps.echo_tool.content looks like [{"type":"text","text":"{\"message\":\"Hello\"}"}] (the exact shape depends on the tool), and read_tool publishes it as reply.
Exercise
Your tool returns structuredContent: {"count": 3}. How do you read count in the next block?