Fix spawn tool: clarify that task parameter must be natural language, not tool call syntax

This commit is contained in:
tanyar09 2026-03-05 15:27:25 -05:00
parent 32cef2df77
commit f39325c846

View File

@ -35,7 +35,16 @@ class SpawnTool(Tool):
return (
"Spawn a subagent to handle a task in the background. "
"Use this for complex or time-consuming tasks that can run independently. "
"The subagent will complete the task and report back when done."
"The subagent will complete the task and report back when done.\n\n"
"CRITICAL: The 'task' parameter MUST be a natural language description of what to do, "
"NOT a tool call. The subagent will figure out how to accomplish the task using its own tools.\n\n"
"CORRECT examples:\n"
"- task='Read all documentation files in the project and create a summary'\n"
"- task='Analyze the codebase structure and generate a report'\n"
"- task='Search for information about X and compile findings'\n\n"
"WRONG (do not use tool call syntax):\n"
"- task='read_dir(path=\"/path/to/file\")'\n"
"- task='read_file(path=\"file.txt\")'"
)
@property
@ -45,7 +54,12 @@ class SpawnTool(Tool):
"properties": {
"task": {
"type": "string",
"description": "The task for the subagent to complete",
"description": (
"A natural language description of the task for the subagent to complete. "
"DO NOT use tool call syntax. Examples: 'Read all documentation and summarize', "
"'Analyze the codebase structure', 'Search the web for X and compile findings'. "
"The subagent will determine which tools to use to accomplish this task."
),
},
"label": {
"type": "string",