MCP Tools Reference
Moira exposes workflow orchestration capabilities through MCP tools. This reference documents all available tools with parameters, return values, and examples.
Tool Categories
Section titled “Tool Categories”Workflow Management
Section titled “Workflow Management”list- List available workflow templatesmanage- Create, edit, or get workflow detailsstart- Start new workflow executionstep- Advance workflow with agent input
Session & Settings
Section titled “Session & Settings”session- Get user, executions, or step infosettings- Manage user settings
Large Files
Section titled “Large Files”token- Generate upload/download tokens
help- Get documentation and help
Lists all available workflow templates with validation status.
Parameters: None
Returns:
- Array of workflow objects with metadata
- Validation status for each workflow
- File paths and last modified timestamps
Example:
list()→ [{ id: "example", name: "Example Workflow", valid: true, ... }]Starts new workflow execution.
Parameters:
workflowId(string, required) - ID of workflow to executenote(string, optional) - Short note to identify this execution (max 500 chars)parentExecutionId(string, required) - Parent execution ID for linking workflows. Use"none"for standalone workflows, or provide parent execution UUID to link child workflows
Returns:
- Process ID for tracking execution
- First agent directive with instructions
- Completion condition and input schema
Example:
start({ workflowId: "example", note: "Feature implementation task" })→ { processId: "abc-123", directive: "...", ... }Parent Execution Linking:
start({ workflowId: "sub-workflow", parentExecutionId: "parent-abc-123" })When child workflow completes, system returns continuation info for the parent execution.
Advances workflow execution with agent input.
Parameters:
processId(string, required) - Process ID from startinput(any) - Agent response matching inputSchema
Returns:
- Next agent directive (if workflow continues)
- Completion status (if workflow finished)
- Updated context and state
Example:
step({ processId: "abc-123", input: { result: "completed", confidence: 9 }})→ { directive: "Next task...", ... }Magic Variable - execution_note:
When input contains execution_note field, it updates the execution’s note for tracking:
step({ processId: "abc-123", input: { task_name: "Auth feature", execution_note: "Implementing OAuth" }})The updated note appears in execution lists (session({ action: "executions" })).
manage
Section titled “manage”Unified tool for workflow CRUD operations.
Action: create
Section titled “Action: create”Creates new workflow from JSON definition with validation.
Parameters:
action:"create"(required)workflow(object, required) - Workflow definitionsystemReminder(string, optional) - Per-workflow system reminder that overrides global setting
overwrite(boolean, optional) - Allow overwriting existing workflow
Returns:
- Success status
- Workflow ID
- Validation results with errors/warnings
Example:
manage({ action: "create", workflow: { id: "my-workflow", metadata: { name: "My Workflow", version: "1.0.0", description: "..." }, nodes: [...] }})→ { success: true, workflowId: "my-workflow", validation: {...} }Action: edit
Section titled “Action: edit”Edits existing workflow with partial updates.
Parameters:
action:"edit"(required)workflowId(string, required) - ID of workflow to editchanges(object, required) - Changes to applymetadata- Update name, version, descriptionaddNodes- Array of nodes to addremoveNodes- Array of node IDs to removeupdateNodes- Array of objects with nodeId and changes propertiessystemReminder- Per-workflow system reminder (set to empty string to clear)
Returns:
- Success status
- Change summary
- Validation results
Example:
manage({ action: "edit", workflowId: "my-workflow", changes: { metadata: { description: "Updated description" }, addNodes: [{ type: "end", id: "new-end", ... }] }})→ { success: true, changesSummary: {...}, validation: {...} }Action: get
Section titled “Action: get”Retrieves workflow information with metadata and validation.
Parameters:
action:"get"(required)workflowId(string, required) - ID of workflow to retrieveincludeNodes(boolean, optional, default: true) - Include node definitionsincludeValidation(boolean, optional, default: true) - Include validation infooffset(number, optional) - Pagination: starting node indexlimit(number, optional) - Pagination: number of nodes to return
Returns:
- Workflow metadata
- Structure analysis
- Nodes (if includeNodes=true)
- Validation status (if includeValidation=true)
Example:
manage({ action: "get", workflowId: "my-workflow", includeNodes: true, includeValidation: true})→ { metadata: {...}, nodes: [...], validation: {...} }Action: get-structure
Section titled “Action: get-structure”Gets workflow structure (metadata + node graph) without full node content. Useful for understanding workflow layout.
Parameters:
action:"get-structure"(required)workflowId(string, required) - ID of workflow to analyzegraph(boolean, optional) - Include ASCII flow visualizationdetailed(boolean, optional) - Include directive previews for each node
Returns:
- Workflow metadata
- Node graph with connections
- ASCII visualization (if graph=true)
- Node previews (if detailed=true)
Example:
manage({ action: "get-structure", workflowId: "my-workflow", graph: true, detailed: true })→ { metadata: {...}, graph: "start → step-1 → step-2 → end", nodesPreview: [...] }Action: get-node
Section titled “Action: get-node”Gets specific node by ID with full content.
Parameters:
action:"get-node"(required)workflowId(string, required) - Workflow IDnodeId(string, required) - Node ID to retrieve
Returns:
- Full node definition
- Connections
- Input schema
Example:
manage({ action: "get-node", workflowId: "my-workflow", nodeId: "step-1" })→ { id: "step-1", type: "agent-directive", directive: "...", ... }Action: search-nodes
Section titled “Action: search-nodes”Searches nodes by text in directive, completionCondition, or ID. Supports regex patterns.
Parameters:
action:"search-nodes"(required)workflowId(string, required) - Workflow IDquery(string, required) - Search text or regex patternincludeVariables(boolean, optional) - Search in workflow variablessnippetMode(boolean, optional) - Return matched text with context onlylimit(number, optional) - Max resultsoffset(number, optional) - Pagination offset
Returns:
- Array of matching nodes
- Match context (where text was found)
- Variable matches (if includeVariables=true)
Example:
manage({ action: "search-nodes", workflowId: "my-workflow", query: "validation", includeVariables: true, snippetMode: true })→ { results: [{ nodeId: "validate-step", matches: ["directive"], snippet: "...run validation..." }] }Action: validate
Section titled “Action: validate”Validates workflow structure and returns errors/warnings.
Parameters:
action:"validate"(required)workflowId(string, required) - Workflow ID
Returns:
- Validation status (valid/invalid)
- Errors array (blocking issues)
- Warnings array (non-blocking issues)
Example:
manage({ action: "validate", workflowId: "my-workflow" })→ { valid: true, errors: [], warnings: ["Node 'old-step' is unreachable"] }Action: list-variables
Section titled “Action: list-variables”Lists all variables from workflow start node initialData.
Parameters:
action:"list-variables"(required)workflowId(string, required) - Workflow ID
Returns:
- Variable count
- Array of variables with name, type, and preview
Example:
manage({ action: "list-variables", workflowId: "my-workflow" })→ { variableCount: 3, variables: [{ name: "test_directive", type: "string", preview: "Run npm test" }] }Action: get-variable
Section titled “Action: get-variable”Gets specific variable value from workflow start node.
Parameters:
action:"get-variable"(required)workflowId(string, required) - Workflow IDvariableName(string, required) - Variable name
Returns:
- Variable name and value
Example:
manage({ action: "get-variable", workflowId: "my-workflow", variableName: "test_directive" })→ { variableName: "test_directive", value: "Run npm test" }Action: set-variable
Section titled “Action: set-variable”Sets or creates variable in workflow start node initialData.
Parameters:
action:"set-variable"(required)workflowId(string, required) - Workflow IDvariableName(string, required) - Variable namevariableValue(any, required) - Variable value
Returns:
- Old and new values
- Success message
Example:
manage({ action: "set-variable", workflowId: "my-workflow", variableName: "test_directive", variableValue: "Run npm test -- --coverage" })→ { variableName: "test_directive", oldValue: "Run npm test", newValue: "Run npm test -- --coverage" }Action: delete-variable
Section titled “Action: delete-variable”Deletes variable from workflow start node initialData.
Parameters:
action:"delete-variable"(required)workflowId(string, required) - Workflow IDvariableName(string, required) - Variable name
Returns:
- Deleted value
- Success message
Example:
manage({ action: "delete-variable", workflowId: "my-workflow", variableName: "unused_var" })→ { variableName: "unused_var", deletedValue: "old value" }Action: diff
Section titled “Action: diff”Compares two workflows and shows differences in metadata and nodes.
Parameters:
action:"diff"(required)workflowId(string, required) - First workflow IDcompareWorkflowId(string, required) - Second workflow ID to compare against
Returns:
- Metadata differences
- Added nodes (in second but not first)
- Removed nodes (in first but not second)
- Modified nodes with change details
Example:
manage({ action: "diff", workflowId: "workflow-v1", compareWorkflowId: "workflow-v2" })→ { metadataDiff: { version: { old: "1.0.0", new: "2.0.0" } }, addedNodes: ["new-step"], removedNodes: [], modifiedNodes: [...] }Action: copy
Section titled “Action: copy”Creates a copy of existing workflow with new ID.
Parameters:
action:"copy"(required)workflowId(string, required) - Source workflow IDnewName(string, optional) - Name for copied workflow
Returns:
- New workflow ID
- Success status
Example:
manage({ action: "copy", workflowId: "template-workflow", newName: "My Copy" })→ { newWorkflowId: "template-workflow-copy-123", success: true }Action: list-nodes
Section titled “Action: list-nodes”Gets compact list of workflow nodes without full content.
Parameters:
action:"list-nodes"(required)workflowId(string, required) - Workflow IDtypeFilter(string, optional) - Filter by node typeincludePreview(boolean, optional) - Include directive previewpreviewLength(number, optional) - Preview character limit
Returns:
- Node count
- Array of compact nodes (id, type, connections)
Example:
manage({ action: "list-nodes", workflowId: "my-workflow", typeFilter: "agent-directive" })→ { nodeCount: 5, nodes: [{ id: "step-1", type: "agent-directive", connections: ["step-2"] }] }Action: get-nodes
Section titled “Action: get-nodes”Gets multiple nodes by ID array in single request.
Parameters:
action:"get-nodes"(required)workflowId(string, required) - Workflow IDnodeIds(string[], required) - Array of node IDs
Returns:
- Found nodes
- Not found node IDs
Example:
manage({ action: "get-nodes", workflowId: "my-workflow", nodeIds: ["step-1", "step-2"] })→ { foundCount: 2, nodes: [...], notFound: [] }Action: analyze-variables
Section titled “Action: analyze-variables”Analyzes variable sources and usages across workflow.
Parameters:
action:"analyze-variables"(required)workflowId(string, required) - Workflow ID
Returns:
- Variable count
- Analysis with sources and usages per variable
Example:
manage({ action: "analyze-variables", workflowId: "my-workflow" })→ { variableCount: 3, analysis: { "task_name": { sources: [...], usages: [...] } } }Action: set-visibility
Section titled “Action: set-visibility”Changes workflow visibility (public/private).
Parameters:
action:"set-visibility"(required)workflowId(string, required) - Workflow IDvisibility(string, required) - “public” or “private”
Returns:
- Previous and new visibility
Example:
manage({ action: "set-visibility", workflowId: "my-workflow", visibility: "public" })→ { previousVisibility: "private", newVisibility: "public" }session
Section titled “session”Unified tool for session and execution information.
Action: user
Section titled “Action: user”Get information about the currently authenticated user.
Parameters:
action:"user"(required)
Returns:
- Name
Example:
session({ action: "user" })→ { email: "user@example.com", name: "John" }Action: executions
Section titled “Action: executions”List active workflow executions for current user.
Parameters:
action:"executions"(required)
Returns:
- Array of active execution objects
- Status, workflow ID, start time for each
Example:
session({ action: "executions" })→ [{ executionId: "abc-123", workflowId: "example", status: "waiting", note: "Feature task", ... }]Action: execution_context
Section titled “Action: execution_context”Get full execution state including context variables.
Parameters:
action:"execution_context"(required)executionId(string, required) - Execution ID to inspect
Returns:
- Execution status (running, waiting, completed, failed)
- Current node information
- Context variables
- Node execution history
Example:
session({ action: "execution_context", executionId: "abc-123" })→ { status: "waiting", currentNodeId: "task-1", context: {...}, ... }Action: current_step
Section titled “Action: current_step”Repeats current workflow step without advancing execution.
Parameters:
action:"current_step"(required)executionId(string, required) - ID of the execution to check
Returns:
- Current directive
- Completion condition
- Input schema
- Context information
Example:
session({ action: "current_step", executionId: "abc-123" })→ { directive: "Complete task...", completionCondition: "...", inputSchema: {...} }Action: update-note
Section titled “Action: update-note”Updates execution note for easier identification in execution lists.
Parameters:
action:"update-note"(required)executionId(string, required) - Execution ID to updatenote(string, required) - New note (max 500 chars)
Returns:
- Success status
- Updated execution ID and note
Example:
session({ action: "update-note", executionId: "abc-123", note: "Step 5: Integration tests" })→ { success: true, executionId: "abc-123", note: "Step 5: Integration tests" }settings
Section titled “settings”Unified tool for user settings management.
Action: get
Section titled “Action: get”Get user settings by category or all settings.
Parameters:
action:"get"(required)category(string, optional) - Filter by category (telegram, ui, profile, etc.)
Returns:
- Settings object with values
- Encrypted fields shown as [encrypted]
Example:
settings({ action: "get", category: "ui" })→ { "ui.theme": "dark", "ui.language": "en" }Action: set
Section titled “Action: set”Set user setting value with validation.
Parameters:
action:"set"(required)key(string, required) - Setting key (e.g., ui.theme, telegram.bot_token)value(any, required) - Setting value
Returns:
- Success status
- Updated value (encrypted if applicable)
Example:
settings({ action: "set", key: "ui.theme", value: "dark"})→ { success: true, key: "ui.theme", value: "dark" }Action: list
Section titled “Action: list”List available setting definitions.
Parameters:
action:"list"(required)category(string, optional) - Category filter
Returns:
- Array of setting definitions with key and description
Example:
settings({ action: "list", category: "telegram" })→ [{ key: "telegram.bot_token", description: "Your Telegram bot token" }]Generate temporary tokens for large workflow file operations.
Action: upload
Section titled “Action: upload”Generate token for uploading large workflows via HTTP.
Parameters:
action:"upload"(required)ttlMinutes(number, optional, default: 60) - Token TTL in minutes
Returns:
token- Upload tokenuploadUrl- Full URL for uploadexpiresAt- ISO 8601 expiration timestampuploadInstructions- Upload details:method:"POST"contentType:"multipart/form-data"fieldName:"workflow"fileFormat:"JSON file with workflow definition"example: curl command example
Upload Request:
curl -X POST "${uploadUrl}" -F "workflow=@your-workflow.json"Example:
token({ action: "upload", ttlMinutes: 30 })→ { token: "abc123", uploadUrl: "https://moiraqq.com/api/public/workflows/upload/abc123", expiresAt: "2024-01-15T12:00:00.000Z", uploadInstructions: { method: "POST", contentType: "multipart/form-data", fieldName: "workflow", fileFormat: "JSON file with workflow definition", example: "curl -X POST '...' -F 'workflow=@your-workflow.json'" } }Action: download
Section titled “Action: download”Generate token for downloading workflows.
Parameters:
action:"download"(required)workflowId(string, required) - Workflow ID to downloadttlMinutes(number, optional, default: 60) - Token TTL in minutes
Returns:
- Download token
- Download URL
- Expiration timestamp
Example:
token({ action: "download", workflowId: "my-workflow", ttlMinutes: 30})→ { token: "abc123", downloadUrl: "https://.../download", expiresAt: "..." }Get documentation and help for the workflow system.
Parameters:
topic(string | string[], optional) - Help topic(s), single or array
Topics:
overview,introduction- System overviewquickstart- Getting started guidenodes- Node types referenceworkflows- Workflow structuretemplates- Template variablestools- This tools referencevalidation- Validation systemclaude-code- Claude Code integrationmcp-clients- Other MCP clientsexamples- Pattern examples with code snippetspattern-*- Workflow patterns (e.g., pattern-workspace, pattern-skip)
Single Topic Example:
help({ topic: "nodes" })→ "# Node Types\n\nMoira supports 7 node types..."Multiple Topics Example:
help({ topic: ["pattern-workspace", "pattern-skip"] })→ "# Workspace Pattern\n...\n\n---\n\n# Skip Pattern\n..."Multiple topics are concatenated with separators for combined documentation lookup.
Related
Section titled “Related”- MCP Agent Guide - How to use MCP tools
- Troubleshooting - Common issues