Query lessons for diff context
query_lessonsFind coding rules most relevant to your code diff or PR, ranked by severity, to guide fixes before opening a PR. Paste your diff and set a token budget to get concise, actionable lessons.
Instructions
Retrieve the learning rules ("lessons") most relevant to a given code diff or PR context, packed within a token budget. Uses bi-encoder retrieval + severity-weighted scoring; pass the diff/description as diffText and a maxTokens budget (default 3000). Returns ranked { lessons: [{ title, rule, severity }] }. Read-only. Use before writing a fix or opening a PR; use list_lessons to browse all lessons unfiltered.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topK | No | Max number of lessons to return (default 15, max 50). (`top_k` is accepted too.) | |
| diffText | Yes | The PR diff, code snippet, or description of the change being made. (`diff_text` is accepted too.) | |
| maxTokens | No | Maximum tokens for returned lessons context (default 3000, max 8000). (`max_tokens` is accepted too.) | |
| projectId | No | Project UUID. Defaults to configured project. (`project_id` is accepted too.) |