fix(tool-use): add question tool schema with mandatory description field
This commit is contained in:
@@ -39,6 +39,43 @@ Based on Anthropic's "Prompt Engineering your Tools" appendix.
|
||||
- `codebase_search`: Semantic search
|
||||
- `question`: Ask user for clarification
|
||||
|
||||
## Question Tool Schema
|
||||
|
||||
When using the `question` tool, each **option** MUST include the required `description` field.
|
||||
|
||||
```json
|
||||
{
|
||||
"questions": [{
|
||||
"question": "Select the next action",
|
||||
"options": [
|
||||
{
|
||||
"id": "deploy",
|
||||
"label": "Deploy to production",
|
||||
"description": "Run the full CI/CD pipeline and deploy.",
|
||||
"icon": "Rocket",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"id": "test",
|
||||
"label": "Run tests first",
|
||||
"description": "Execute the test suite before deploying.",
|
||||
"icon": "TestTube"
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
```
|
||||
|
||||
**Required fields per option:**
|
||||
- `id` — unique identifier for the option.
|
||||
- `label` — short display text.
|
||||
- `description` — **MANDATORY** detailed explanation of what happens when this option is selected.
|
||||
- `icon` (optional) — visual icon name.
|
||||
- `default` (optional) — pre-select this option.
|
||||
|
||||
**Common Error:**
|
||||
`SchemaError(Missing key at ["options"][0]["description"])` — ensure every option object contains a non-empty `description`.
|
||||
|
||||
## Tool Documentation
|
||||
|
||||
From Anthropic research: Invest as much effort in ACI (Agent-Computer Interface) as HCI:
|
||||
|
||||
Reference in New Issue
Block a user