Create a Command
-
Within the
.angrealfolder of a project create a file that starts withtask_and ends with.py. -
Define a function.
-
Apply
commanddecorator.
import angreal
@angreal.command(
name='command-name',
about='Short description for --help',
tool=angreal.ToolDescription("""
Detailed description of what the command does.
## When to use
- During development
- For testing features
## When NOT to use
- In production deployments
- When debugging
## Examples
angreal command-name angreal command-name –flag
""", risk_level="safe")
)
def command_function():
return
The tool parameter accepts a ToolDescription object that provides rich guidance for AI agents via MCP:
angreal.ToolDescription(description, risk_level="safe")
- description: Prose description with markdown. Include “When to use”, “When NOT to use”, and “Examples” sections.
- risk_level: One of
"safe","read_only", or"destructive". Maps to MCP tool annotations.
This enables AI agents to understand when and how to use your commands appropriately.