Skip to content

Commit e8f248d

Browse files
committed
Update spawn agents tool to emphasize the required fields and add real examples
1 parent 9fb9fe7 commit e8f248d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

common/src/tools/params/tool/spawn-agents.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,26 @@ Each agent available is already defined as another tool, or, dynamically defined
3939
4040
You can call agents either as direct tool calls (e.g., \`example-agent\`) or use \`spawn_agents\`. Both formats work, but **prefer using spawn_agents** because it allows you to spawn multiple agents in parallel for better performance. When using direct tool calls, the schema is flat (prompt is a field alongside other params), whereas spawn_agents uses nested \`prompt\` and \`params\` fields.
4141
42+
**IMPORTANT**: Many agents have REQUIRED fields in their params schema. Check the agent's schema before spawning - if params has required fields, you MUST include them in the params object. For example, code-searcher requires \`searchQueries\`, commander requires \`command\`.
43+
4244
Example:
4345
${$getNativeToolCallExampleString({
4446
toolName,
4547
inputSchema,
4648
input: {
4749
agents: [
4850
{
49-
agent_type: 'example-agent',
50-
prompt: 'Create a plan for implementing user authentication',
51-
params: { filePaths: ['src/auth.ts', 'src/user.ts'] },
51+
agent_type: 'commander',
52+
prompt: 'Check if tests pass',
53+
params: {
54+
command: 'npm test',
55+
},
56+
},
57+
{
58+
agent_type: 'code-searcher',
59+
params: {
60+
searchQueries: [{ pattern: 'authenticate', flags: '-g *.ts' }],
61+
},
5262
},
5363
],
5464
},

0 commit comments

Comments
 (0)