Skip to main content

Orchestrator - MCP Tool Specification

This document specifies the MCP tools currently implemented in the Orchestrator module.

Note: This spec was updated to reflect the actual implementation in mcp_tools.py. Previously documented tools (run_workflow, list_workflows, create_workflow, cancel_workflow) are not yet implemented — they are planned future additions. See the Planned Tools section below.

General Considerations​

  • Tool Integration: This module provides scheduler metrics and workflow DAG analysis.
  • Category: orchestrator
  • Auto-discovered: Yes (via @mcp_tool decorator in mcp_tools.py)

Tool: get_scheduler_metrics​

1. Tool Purpose and Description​

Retrieve the current metrics of the Orchestrator's AsyncScheduler, including jobs scheduled, completed, failed, cancelled, and total execution time.

2. Invocation Name​

get_scheduler_metrics

3. Input Schema (Parameters)​

None — this tool takes no parameters.

4. Output Schema​

FieldTypeDescription
statusstring"success" or "error"
metrics.total_jobsintegerTotal jobs scheduled
metrics.completedintegerJobs completed successfully
metrics.failedintegerJobs that failed
metrics.cancelledintegerJobs that were cancelled
metrics.execution_timefloatCumulative execution time in seconds
messagestringError message (only on "error" status)

5. Example Usage​

// Request: no parameters
// Response (success):
{
"status": "success",
"metrics": {
"total_jobs": 42,
"completed": 38,
"failed": 2,
"cancelled": 2,
"execution_time": 314.7
}
}

Tool: analyze_workflow_dependencies​

1. Tool Purpose and Description​

Analyze a proposed workflow task graph (DAG) for cyclic dependencies. Validates that the workflow can be scheduled and returns a valid execution order if the graph is acyclic.

2. Invocation Name​

analyze_workflow_dependencies

3. Input Schema (Parameters)​

Parameter NameTypeRequiredDescriptionExample Value
tasksarray[object]YesList of task descriptors with id and dependenciesSee example

Each task object:

FieldTypeRequiredDescription
idstringYesUnique task identifier
dependenciesarray[string]NoIDs of tasks this task depends on

4. Output Schema​

FieldTypeDescription
statusstring"success" or "error"
valid_dagbooleantrue if no cycles detected
execution_orderarray[string]Topological order of task IDs (on success)
messagestringError details (on "error" or cycle detected)

5. Example Usage​

// Request:
{
"tasks": [
{"id": "build", "dependencies": []},
{"id": "test", "dependencies": ["build"]},
{"id": "deploy", "dependencies": ["test"]}
]
}

// Response (valid DAG):
{
"status": "success",
"valid_dag": true,
"execution_order": ["build", "test", "deploy"]
}

// Response (cycle detected):
{
"status": "error",
"valid_dag": false,
"message": "Cycle detected: deploy -> build -> deploy"
}

Planned Tools (Not Yet Implemented)​

The following tools are documented as future work. They do not exist in the current implementation and will raise NotImplementedError until implemented.

Tool NameDescription
run_workflowExecute a named workflow with parameters and dry-run support
list_workflowsList all available workflow definitions
create_workflowCreate a new workflow definition from a task graph
cancel_workflowCancel a running workflow by ID