ask_history
Answers natural-language questions about your shell history by retrieving relevant commands and citing them, so you can find how past tasks were done.
Instructions
Read-only. Answers a natural-language question about your shell history, with citations (retrieval-augmented generation). Retrieves the top k entries with hybrid search, then, if TERMINAL_HISTORY_CHAT_MODEL is set, asks that chat model to answer only from those entries and cite them as [id:N]. Retrieved commands are passed as delimited untrusted data, never as instructions. Replies exactly "No relevant history found." when nothing retrieved is relevant. Without a chat model it returns the retrieved context only. Cited ids are checked against the retrieved set; any others are listed in invalid_citation_ids.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"question": "<question>"
},
"name": "ask_history"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | Number of entries to retrieve as context. Default 8. | |
| question | Yes | Natural-language question, e.g. "how did I free up docker disk space?" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| answer | No | Model answer with [id:N] citations; null when no chat model is configured. | |
| cited_ids | No | Cited ids that exist in the retrieved set. | |
| retrieved | No | Context given to the model. | |
| cited_entries | No | ||
| keyword_error | No | ||
| retrieval_mode | No | `hybrid`, or `keyword` if it fell back. | |
| fallback_reason | No | ||
| invalid_citation_ids | No | Ids the model cited that were not retrieved. |