FrostAgent’s subagent system allows the main orchestrating agent to offload specialized work to purpose-built sub-agents, each carrying a focused system prompt tuned for a particular domain. Rather than burdening a single model with every kind of task, the main agent identifies when a specialist is better suited, callsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/GuaiZai233/FrostAgent/llms.txt
Use this file to discover all available pages before exploring further.
use_subagent, and seamlessly incorporates the result into its final response — keeping interactions coherent while improving output quality for targeted tasks like code generation.
The use_subagent Tool
The use_subagent tool is the main agent’s only entry point into the subagent system. It is registered under the tool name use_subagent and is backed by a dispatch manager whose guiding prompt is:
The tool description instructs the main agent to call
send_message before invoking a subagent. This ensures the user receives immediate feedback — such as “I’m delegating this to the Coder agent” — rather than experiencing a silent pause while the subagent runs.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
subagent_name | string | ✅ | The name of the subagent to invoke. Currently only "Coder" is supported. |
content | string | ✅ | The task description or content to pass to the subagent. |
JSON Schema
How Subagent Dispatch Works
When the main LLM decides that a task is best handled by a subagent, the following sequence takes place:Main LLM decides to delegate
The main agent’s reasoning loop identifies a task that matches a known subagent — for example, a code generation request triggers
use_subagent.send_message is called first
Before dispatching, the main agent calls
send_message to notify the user that work has been assigned to a subagent (e.g., “I’m asking the Coder agent to handle this”).SubAgentTool.Execute is called
The FrostAgent engine invokes
SubAgentTool.execute(args) with a JSON-encoded string containing subagent_name and content.Parameters are parsed
The tool unmarshals the JSON arguments into a typed struct, extracting
SubagentName and Content.Appropriate subagent function is called
Based on
SubagentName, the tool calls the matching subagent function — for "Coder", it calls subagent.CallCoder(client, "", "", "", params.Content).Available Subagents
| Name | Purpose | API Key Env Var |
|---|---|---|
Coder | Code generation and programming tasks | CODER_API_KEY |
Adding New Subagents
Extending the subagent system with a new specialist requires three steps: 1. Implement the subagent function Create a new file in thesubagent/ package. Follow the same pattern as coder.go: accept a *llm.Client, relevant configuration parameters, and the task content; return the model’s response as a string.
case in SubAgentTool.execute
Open internal/tools/subagent.go and add a branch for the new name inside the execute closure:
description field of the Tool struct so the main LLM knows it exists and when to use it.
For a deep dive into the built-in Coder subagent, see the Coder subagent reference. To learn how to build fully custom tools from scratch, see the Custom Tools guide.