Retrieve Lessons
retrieve_lessonsFind applicable lessons for an upcoming tool call to guide safe execution and prevent repeated errors. Use in pre-action workflows to apply past feedback before risky commands run.
Instructions
Retrieve the most relevant lessons for a given tool/action context. Use in PreToolUse hooks for per-action guidance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | ||
| filters | No | Pre-filter the candidate corpus before lexical or vector ranking. | |
| toolName | Yes | The tool being called (e.g., Bash, Edit, Read) | |
| maxResults | No | Max lessons to return (default 5) | |
| queryRewrite | No | Enable bounded deterministic synonym expansion when the original lexical match is weak. Defaults true. | |
| requireScope | No | Fail closed unless a complete four-field scope is supplied. | |
| actionContext | No | Description of what the tool call is doing | |
| includeShared | No | Include explicitly shared memories with scoped results. Defaults true. | |
| includeRetrievalMeta | No | Include path provenance such as lexical/dense pools and query variants. |