Skip to content

Advanced Steps

Beyond the foundational steps, CARL ships step types for MCP, skills, multi-agent orchestration, and more. Each gets a full guide in its own section; this page is the map with the essentials.

MCPStepDescription + MCPStepConfig. Transports: stdio, http, sse.

from mmar_carl import MCPStepDescription
from mmar_carl.models.config import MCPStepConfig, MCPServerConfig
MCPStepDescription(
number=1,
title="Call MCP tool",
config=MCPStepConfig(
server=MCPServerConfig(server_name="my_server", command="python", args=["-m", "my_mcp_server"]),
tool_name="search",
argument_mapping={"query": "$history[-1]"},
),
)

→ Full guide: MCP overview.

MCP resource — read a resource into memory

Section titled “MCP resource — read a resource into memory”

MCPResourceStepDescription + MCPResourceStepConfig. Fetches read-only data (files, docs, schemas) and writes it to memory + history.

from mmar_carl import MCPResourceStepDescription
from mmar_carl.models.config import MCPResourceStepConfig, MCPServerConfig
MCPResourceStepDescription(
number=1,
title="Load API reference",
config=MCPResourceStepConfig(
server=MCPServerConfig(server_name="docs", transport="sse", url="http://docs/sse"),
resource_uri="docs://api/reference.md",
output_memory_key="api_docs",
),
)

AgentHandoffStepDescription runs a complete sub-chain with an isolated context; inputs are resolved from parent memory/history and the result is merged back via config.output_memory_key.

from mmar_carl import AgentHandoffStepDescription
from mmar_carl.models.config import AgentHandoffStepConfig
AgentHandoffStepDescription(
number=3,
title="Delegate to research agent",
sub_chain=research_chain,
config=AgentHandoffStepConfig(
input_mapping={"input.topic": "$memory.input.topic"},
output_memory_key="research_result",
),
)

The sub-chain’s full ReasoningResult is available at step_result.result_data["sub_result"].

StepClass · configWhat it doesExample
AgentSkillAgentSkillStepDescription · AgentSkillStepConfigRun an AgentSkill folder (LLM / SCRIPT / HYBRID / SUBAGENT / LLM_AGENT modes; sandboxed).agent_skill_example.py
SupervisorSupervisorStepDescription · SupervisorStepConfigLLM routes the task to one of N registered specialist sub-chains.supervisor_routing_example.py
DebateDebateStepDescription · DebateStepConfigRound-robin role-based debate, then a judge synthesises.—
Parallel samplingParallelSamplingStepDescription · ParallelSamplingStepConfigSample N independent responses, then vote / LLM-judge the best.llm_council_example.py
Human inputHumanInputStepDescription · HumanInputStepConfigPause for human input (in-process callable or webhook).human_in_the_loop_example.py
Tool discoveryToolDiscoveryStepDescription · ToolDiscoveryStepConfigDiscover + register tools at runtime from a module / callables / dict.—
EvaluationEvaluationStepDescription · EvaluationStepConfigInline quality gate on a prior step’s output; reacts via on_fail (continue / abort / retry-with-feedback).—