Skip to content

Preflight

Before running a saved chain you want to know what it will use, so you can register or install the missing pieces. ReasoningChain answers this without executing anything and without an LLM call.

chain.required_tools() # tool names from tool / map / agent / planner steps and chain tools' allowed_tools
chain.required_mcp_servers() # MCP server names
chain.required_skills() # AgentSkill identifiers (URI or source string)
chain.required_code_profiles() # runtime_profile names of code steps
chain.required_claude_code_clis() # cli_path of claude_code steps (default "claude")
chain.required_codex_runtimes() # ["openai-codex"] if the chain has a codex step
chain.required_decision_credentials() # API-key env var names of decision steps (0.5.1)

Tools found only at run time by a tool-discovery step are not listed. Names of embedded chain tools are left out, because the chain supplies them itself.

chain.preflight(context) compares those lists with what the context has and returns a PreflightReport:

report = chain.preflight(context)
print(report.format_text())
if not report.all_present:
print("register first:", report.missing_tools)
Field / memberHow “missing” is decided
required_*Everything the chain references (seven lists, as above).
missing_toolsNot in context.list_tools().
missing_code_profilescontext.code_execution_policy is absent or does not resolve the profile.
missing_claude_code_clisshutil.which() cannot find the CLI.
missing_codex_runtimescheck_codex_runtime() reports the runtime unavailable.
missing_decision_credentialsThe env var is unset or empty. Only names are reported, never values. The host grant in decision_endpoints is not checked here; the step checks it at run time.
missing_mcp_servers / missing_skillsAlways empty. MCP servers carry their own config and skills resolve over the network at run time, so preflight lists them but does not check them.
all_present (property)True when every missing_* list is empty.
format_text()One line when everything is present, a breakdown otherwise.

The report is data, not prose: MAESTRO turns it into a refusal or a dialog, and CLIs and CI read the lists directly.

MAESTRO runs preflight twice: once on the parsed chain without a context (to list requirements), and once against the populated run context right before execution. A missing tool, MCP server or skill refuses the run. MAESTRO’s pinned CARL build predates code profiles, Claude Code, Codex and decision steps, so its report has no such lists (see which CARL MAESTRO runs). From the command line, maestro validate <chain.json> parses and preflights a chain file (see CLI discovery).