FoundationAgents/OpenManus · warning · ToolError
Unrecognized command: {command}. Allowed commands are: creat
Error message
Unrecognized command: {command}. Allowed commands are: create, update, list, get, set_active, mark_step, delete What it means
Raised by the planning tool's execute() dispatch (app/tool/planning.py:116) when the command string matches none of the seven supported commands (create, update, list, get, set_active, mark_step, delete). It is the fallback branch of an if/elif chain; note that execute() also declares command as a Literal type, so well-typed callers get static errors first — this guard catches untyped/dynamic callers (e.g. LLM-issued tool calls).
Source
Thrown at app/tool/planning.py:116
- step_notes: Additional notes for a step (used with mark_step command)
"""
if command == "create":
return self._create_plan(plan_id, title, steps)
elif command == "update":
return self._update_plan(plan_id, title, steps)
elif command == "list":
return self._list_plans()
elif command == "get":
return self._get_plan(plan_id)
elif command == "set_active":
return self._set_active_plan(plan_id)
elif command == "mark_step":
return self._mark_step(plan_id, step_index, step_status, step_notes)
elif command == "delete":
return self._delete_plan(plan_id)
else:
raise ToolError(
f"Unrecognized command: {command}. Allowed commands are: create, update, list, get, set_active, mark_step, delete"
)
def _create_plan(
self, plan_id: Optional[str], title: Optional[str], steps: Optional[List[str]]
) -> ToolResult:
"""Create a new plan with the given ID, title, and steps."""
if not plan_id:
raise ToolError("Parameter `plan_id` is required for command: create")
if plan_id in self.plans:
raise ToolError(
f"A plan with ID '{plan_id}' already exists. Use 'update' to modify existing plans."
)
if not title:
raise ToolError("Parameter `title` is required for command: create")
View on GitHub (pinned to 52a13f2a57)
Solutions
- Use one of the exact allowed strings: create, update, list, get, set_active, mark_step, delete (lowercase, underscore-separated).
- Normalize and validate model-issued commands before dispatch: strip().lower() and check membership in the allowed set, with a corrective message back to the model.
- After tool upgrades, grep prompts/schemas for stale command names and update them.
Example fix
// before
await planning.execute(command='delete_plan', plan_id='p1')
// after
ALLOWED = {'create','update','list','get','set_active','mark_step','delete'}
cmd = raw_cmd.strip().lower()
if cmd not in ALLOWED:
return f"Unknown command {raw_cmd!r}; use one of {sorted(ALLOWED)}"
await planning.execute(command=cmd, plan_id='p1') Defensive patterns
Strategy: validation
Validate before calling
ALLOWED = ('create', 'update', 'list', 'get', 'set_active', 'mark_step', 'delete')
cmd = raw.strip().lower()
if cmd not in ALLOWED:
return f'Unknown command {raw!r}; allowed: {ALLOWED}'
await planning.execute(command=cmd, **params) Type guard
from typing import Literal
PlanningCommand = Literal['create','update','list','get','set_active','mark_step','delete']
def is_planning_command(c: str) -> TypeGuard[PlanningCommand]:
return c in {'create','update','list','get','set_active','mark_step','delete'} Try / catch
try:
await planning.execute(command=cmd)
except ToolError as e:
if 'Unrecognized command' in str(e):
reply_to_model_with_allowed_commands()
else:
raise Prevention
- Type command as the Literal in caller signatures so static checkers catch typos.
- Normalize LLM-issued commands (strip().lower()) before dispatch.
- Include the allowed-command list in the corrective feedback loop for model callers.
When it happens
Trigger: An LLM/tool caller passes command='delete_plan', 'createPlan', 'Add', ' remove' (whitespace), or any casing/typo variant; invoking the tool programmatically with a string not in the Literal set. Only exact lowercase matches dispatch.
Common situations: Agent frameworks where the model invents command names not in the tool schema; model output with casing or trailing whitespace; schema drift after upgrading the tool (a command removed or renamed) while prompts still reference the old name.
Related errors
- No primary agent available
- Parameter `plan_id` is required for command: create
- A plan with ID '{plan_id}' already exists. Use 'update' to m
- Parameter `title` is required for command: create
- Parameter `steps` must be a non-empty list of strings for co
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/f589e1b393f76bde.
Report an issue: GitHub.