Skip to content

MCP Agent Guide

This guide explains how AI agents use MCP Moira tools to execute workflows.

MCP Moira exposes these tools:

ToolPurpose
listList available workflows
startStart workflow execution
stepAdvance workflow with input
manageCRUD operations on workflows
sessionUser info and execution state
settingsUser settings
tokenUpload/download tokens
helpDocumentation
start({ workflowId: "task-breakdown-flow" })

Returns:

{
"processId": "abc-123-def",
"directive": "Break down the task into steps...",
"completionCondition": "Task breakdown complete with 3+ steps",
"inputSchema": {
"type": "object",
"properties": {
"steps": { "type": "array" }
},
"required": ["steps"]
}
}

After completing the work described in directive:

step({
processId: "abc-123-def",
input: {
"steps": ["Step 1", "Step 2", "Step 3"]
}
})

Returns next directive or completion status.

Repeat step() calls until workflow returns completion.

Every workflow step returns:

FieldDescription
processIdUUID for this execution, use in all step() calls
directiveWhat to do (the instruction)
completionConditionWhen you’re done (success criteria)
inputSchemaHow to structure your response (JSON Schema)

directive = WHAT to do completionCondition = WHEN you’re successfully done

Example:

  • directive: “Run all project tests”
  • completionCondition: “All tests pass (0 failures)”

The agent must:

  1. Execute the directive (run tests)
  2. Verify the completionCondition is met (check for 0 failures)
  3. Only then proceed with step()

When inputSchema is provided, your response must match the schema exactly.

Example schema:

{
"type": "object",
"properties": {
"result": {
"type": "string",
"enum": ["pass", "fail"]
},
"evidence": {
"type": "string"
}
},
"required": ["result", "evidence"]
}

Valid response:

{
"result": "pass",
"evidence": "All 302 tests passed"
}
session({ action: "executions" })

Returns all active executions for current user with status, workflow ID, and notes.

Resume workflow after interruption:

session({ action: "current_step", executionId: "abc-123" })

Returns current directive without advancing the workflow.

session({ action: "execution_context", executionId: "abc-123" })

Returns execution state including context variables and history.

Track execution progress with notes:

start({ workflowId: "dev-flow", note: "Feature: auth system" })

Update note during execution via step() input:

step({
processId: "abc-123",
input: {
"task_result": "done",
"execution_note": "Step 3: Integration tests"
}
})

Or via session tool:

session({
action: "update-note",
executionId: "abc-123",
note: "Step 3: Integration tests"
})
list()
list({ search: "test" })
list({ visibility: "public", limit: 10 })
// 1. Start
start({ workflowId: "research" })
// → { processId: "xyz", directive: "...", ... }
// 2. Do work, then advance
step({ processId: "xyz", input: { findings: "..." } })
// → { directive: "next step...", ... }
// 1. Find your execution
session({ action: "executions" })
// → [{ executionId: "xyz", status: "waiting", ... }]
// 2. Get current step
session({ action: "current_step", executionId: "xyz" })
// → { directive: "...", completionCondition: "...", ... }
// 3. Continue
step({ processId: "xyz", input: { ... } })

If step() returns validation error, check:

  1. Field names - Must match schema exactly (case sensitive)
  2. Required fields - All required properties must be present
  3. Data types - String vs number vs boolean must match
  4. Enum values - Must be one of allowed values