Skip to Content
MissionsInternal Tools

Internal Tools

Missions use specialized internal tools that enable communication between commanders and agents. These tools are automatically available during mission execution and are managed by the system.

Note: These tools are used internally by the mission runtime. You do not need to configure or reference them in your mission definitions — they are automatically available to commanders and agents as needed.

Commander Tools

Commanders have access to tools for planning work, delegating to agents, submitting outputs, and querying data from completed tasks.

Subtask Planning

Every commander must plan its work using subtasks before doing anything else.

set_subtasks

Define the ordered subtasks for the current task. This must be the commander’s first action.

{ "subtasks": ["Research the API endpoints", "Implement data extraction", "Validate results"] }
ParameterTypeDescription
subtasksarray of stringsOrdered list of 1-10 subtask titles (required)

Once any subtask has been completed, the plan is locked and set_subtasks cannot be called again. For sequential dataset tasks, set_subtasks can be called again after each dataset_next advancement.

get_subtasks

Get all subtasks with their current status.

{}

Returns each subtask’s index, title, and status (pending, in_progress, or completed).

complete_subtask

Mark the current subtask as completed and advance to the next one.

{}

Completes the first non-completed subtask in order. All subtasks must be completed before calling task_complete.

Task Completion

task_complete

Signal that the task is done. Always include a summary of key findings and results — this is passed as context to downstream dependent tasks.

{ "summary": "Analyzed the data and found 3 key trends...", "succeed": true }

With routing: If the task has a router block, route options are injected as a system prompt. The commander must include a route parameter when calling task_complete:

{ "summary": "Classified request as billing issue based on keyword analysis.", "route": "handle_billing" }

Use "route": "none" if no route condition applies.

For cross-mission routes, include mission_inputs for the target mission’s required inputs:

{ "summary": "Escalation required due to severity.", "route": "escalation_mission", "mission_inputs": { "complaint_summary": "Customer demands refund for defective product", "severity": "critical" } }

Failure:

{ "succeed": false, "reason": "Unable to complete — external API is unreachable." }
ParameterTypeDescription
routestringKey of the chosen route, or "none" (optional — only for routing tasks)
mission_inputsobjectInput values for mission route targets (optional — only for cross-mission routes)

See Routing for full details.

submit_output

Submit structured output for the task. Only available when the task defines an output schema.

{ "output": { "total_revenue": 150000, "top_product": "Widget Pro" } }
ParameterTypeDescription
outputobjectThe structured output matching the task’s output schema (required)

For iterated tasks, submit_output is called once per item. Required output fields are validated automatically.

Agent Delegation

call_agent

Delegate a task to an agent.

{ "name": "assistant", "task": "Fetch the current weather for Chicago, IL" }
ParameterTypeDescription
namestringName of the agent to call (required)
taskstringTask description for the agent (required)

The commander waits for the agent to complete and receives the result.

ask_agent

Query an agent that was used by a dependency task. Use this to get additional information from agents that have already executed and have relevant context.

{ "agent_id": "assistant", "question": "What API endpoints did you use?" }
ParameterTypeDescription
agent_idstringName of the agent (matches the name used in call_agent) (required)
questionstringQuestion to ask the agent (required)

The agent responds from its existing conversation context without making new tool calls.

Data Querying

query_task_output

Query structured data from completed dependency tasks.

{ "task": "fetch_sales", "filters": [{"field": "amount", "op": "gt", "value": 1000}], "limit": 10 }
Query Options
OptionDescription
taskTask name to query (required)
filtersArray of filter conditions
item_idsSpecific item IDs for iterated tasks
limitMaximum results (default: 20)
offsetSkip N results
order_byField to sort by
descSort descending
aggregateAggregate operation
Filter Operators
OperatorDescription
eqEqual to
neNot equal to
gtGreater than
ltLess than
gteGreater than or equal
lteLess than or equal
containsString contains
Aggregate Operations
{ "task": "get_weather", "aggregate": { "op": "avg", "field": "temperature" } }
OperationDescription
countCount matching items
sumSum of field values
avgAverage of field values
minMinimum value (returns item)
maxMaximum value (returns item)
distinctUnique values
group_byGroup and aggregate
Group By Example
{ "task": "get_weather", "aggregate": { "op": "group_by", "group_by": "state", "group_op": "avg", "field": "temperature" } }

ask_commander

Ask a follow-up question to a completed commander from a dependency task. Use this when you need more details than what’s available in the structured output.

{ "task_name": "fetch_sales", "question": "What was the average order value for premium customers?" }
ParameterTypeDescription
task_namestringName of the completed dependency task (required)
questionstringFollow-up question to ask (required)
indexintegerFor iterated tasks: the iteration index to query

The queried commander will answer from its existing context and can use ask_agent to query its own agents if needed.

Querying Iterated Tasks

For tasks that iterate over a dataset, use the index parameter to query a specific iteration’s commander. Get the index from query_task_output results — each iteration has an index field.

{ "task_name": "process_cities", "index": 2, "question": "Why was this city flagged for review?" }

Context behavior: The first query to a commander creates a clone from its completed state. Subsequent queries to the same commander build on previous questions and answers, enabling natural follow-up conversations.

list_commander_questions

List questions that have already been asked to a dependency task’s commander. Useful in parallel iterations to avoid asking duplicate questions.

{ "task_name": "fetch_sales" }
ParameterTypeDescription
task_namestringName of the dependency task (required)

Returns a list of previously asked questions with their indices.

get_commander_answer

Get a cached answer for a previously asked question by its index. Use with list_commander_questions to reuse answers from other iterations.

{ "task_name": "fetch_sales", "index": 0 }
ParameterTypeDescription
task_namestringName of the dependency task (required)
indexintegerIndex of the question from list_commander_questions (required)

Sequential Dataset Processing

These tools are available when a task iterates over a dataset sequentially (parallel = false).

dataset_next

Get the next item from the dataset for sequential processing.

{}

Returns the next item with its index and total count. Returns {"status": "exhausted"} when all items have been processed.

Constraints:

  • submit_output must be called for the current item before advancing
  • All subtasks must be completed before advancing (if subtasks are defined)

Agent Tools

Agents have access to the tools configured in their agent definition, plus mission-level dataset tools when running in mission context. See Tools for configuring agent tools.

Dataset Tools

When running inside a mission, agents automatically get these dataset tools:

ToolDescription
set_datasetPopulate a dataset with items
dataset_sampleGet sample items from a dataset
dataset_countGet the number of items in a dataset
result_to_datasetConvert a large intercepted result into a dataset for iteration

See Datasets for details and examples.

Last updated on