Magic Variables
Overview
Section titled “Overview”Magic variables are special input fields that trigger automatic behavior beyond normal context storage.
execution_note
Section titled “execution_note”Updates the execution’s note field for tracking purposes.
{ "inputSchema": { "type": "object", "properties": { "execution_note": { "type": "string", "description": "Note to identify this execution" } } }}Behavior
Section titled “Behavior”When agent provides execution_note:
- Value stored in context like normal
- Execution record’s
notefield updated in database - Note visible in execution lists and session queries
Use Cases
Section titled “Use Cases”Track what’s being worked on:
{ "directive": "Document what you're working on for tracking.", "inputSchema": { "properties": { "execution_note": { "type": "string", "description": "Feature/task being developed" } }, "required": ["execution_note"] }}Update note on task changes:
{ "directive": "Task requirements changed. Update the execution note.", "inputSchema": { "properties": { "execution_note": { "type": "string" } } }}Querying Notes
Section titled “Querying Notes”Notes appear in session queries:
mcp__moira__session({ action: "executions" });// Returns executions with note field populatedSystem Variables
Section titled “System Variables”These variables are automatically available in context:
executionId
Section titled “executionId”Current process execution ID.
{{executionId}}workflowId
Section titled “workflowId”Current workflow identifier.
{{workflowId}}Usage Example
Section titled “Usage Example”{ "directive": "Process ID: {{executionId}}\nWorkflow: {{workflowId}}\n\nDocument this for reference."}Expression Variables
Section titled “Expression Variables”Variables modified by expression nodes:
Counter Variables
Section titled “Counter Variables”Set in initialData:
{ "initialData": { "current_step_index": 1, "current_iteration": 1 }}Modified by expression:
{ "type": "expression", "expressions": ["current_step_index = current_step_index + 1", "current_iteration = 1"]}Template Processing
Section titled “Template Processing”All magic and context variables work with templates:
Simple Access
Section titled “Simple Access”{{variable_name}}Nested Access
Section titled “Nested Access”{{user.profile.name}}Array Access
Section titled “Array Access”{{items[0]}}{{items[0].field}}Conditional Templates
Section titled “Conditional Templates”{{#if execution_note}}Note: {{execution_note}}{{/if}}See Also
Section titled “See Also”- Input Schema - Validating magic variable inputs
- Templates - Template syntax details