| get_answerA | Synthesised answer with citations and a calibrated trust signal. The single entry point for questions: "how does X work" / "where is Y" /
"why is Z". It runs the full hybrid retrieval internally (no prior
search_codebase call needed) and answers in one round-trip.
confidence=high is content-grounded (value + citation-source + frame
gates): cite it directly, no verification Read needed. A "why" answer
whose named mechanism is absent from the retrieved source is downgraded
to medium (the rationale may be conflated). Low confidence returns
best_guesses with one-line justifications instead of an empty answer.
retrieval_quality separately rates the retrieval that fed synthesis.
When the answer names a function/method/class, ``symbol_bodies`` carries
its full live body — read that instead of a follow-up get_symbol.
``episodes``, when present, is a dated fact recorded about this checkout
that bears on the question — evidence beside the answer, not a correction
of it. Weigh it against the answer; ``still_true`` says how current it is.
Args:
question: developer question.
scope: optional path-prefix filter (e.g. "src/pkg/").
repo: usually omitted.
|
| get_change_riskA | Score a live commit or base..head range from its diff shape. Use this for a pre-merge score of a commit or PR range. It is distinct from
``get_risk``, which assesses indexed files and PR blast radius. Both filters
below also apply to the baseline used for the repository percentile.
Prefer ``risk_percentile`` as the indicator of change risk: it ranks this
change against sampled recent commits in the same repository. Summarize it
with ``review_priority`` and ``classification``. ``score``, ``probability``,
and ``level`` are secondary corpus-calibrated context, the fallback only
when ``risk_percentile`` is unavailable.
``impacted_tests`` names the tests the per-test coverage map proves execute
the change's changed *lines* (line-precise, narrower than get_risk's
file-level ``tests_to_run``), with ``missing_tests`` buckets for changed
lines no test covers. Its ``status`` is ``no_map`` (unknown, run the full
suite), never "untested", when no map is ingested.
``prior_fixes`` appears only when the changed files carry counted bug fixes:
per-file counts, never a commit name.
Args:
revspec: Commit or ``base..head`` range to score. Defaults to ``HEAD``.
repo: Repository alias in workspace mode; omit for the default repository.
extensions: File suffixes to count, for example ``[".py", ".ts"]``.
exclude_patterns: Gitignore-style paths to omit, for example ``["tests/", "*.md"]``.
baseline: Recent commits to sample for percentile ranking; 0 disables it.
|
| get_contextA | Triage card for files / modules / symbols — relationships, not source bytes. Returns title, summary, signatures with line numbers, hotspot bit, and
decision_record titles. fix_history appears only on files with counted bug
fixes (count, age, bug_magnet); hotspot is churn. Either one is a cue to
call get_risk. episodes counts the dated records bound to a target — what
happened here and why — and appears only when there is at least one;
get_why serves the bodies. A symbol target is counted as its file, and a
module aggregates everything beneath it.
Batch targets in one call. No source bytes by default: pass
include=["skeleton"] for the whole file body-elided and line-verified in
ONE call, or Read it. Do not call get_symbol per signature.
Args:
targets: file paths, module paths, or "path::Symbol" ids.
include: opt-in blocks: full_doc | ownership | last_change | callers
| callees | metrics | community | decisions | skeleton.
compact: default True; False adds structure+imports+docstrings.
repo: usually omitted.
|
| get_dead_codeA | Unused exports, unreachable files, zombie packages — tiered by confidence. Run before a cleanup sprint, not a targeted fix. Findings tier
high/medium/low with per-directory and per-owner rollups; workspace
mode lowers confidence on findings other repos import.
Args:
repo: usually omitted.
kind: unreachable_file | unused_export | unused_internal | zombie_package.
min_confidence: floor, default 0.4 (0.7 = cleanup-ready only).
safe_only: deletion-ready findings only (no runtime-load risk).
limit: max findings per tier (clamped to 25).
tier: "high" (>=0.8) | "medium" | "low".
directory: path-prefix filter.
owner: primary-owner filter.
group_by: "directory" | "owner" rollup.
include_internals: also scan private symbols (more false positives).
include_zombie_packages: monorepo package findings (default true).
no_unreachable: skip file-level reachability findings.
no_unused_exports: skip public-export findings.
|
| get_healthA | Code-health scores and findings — self-check a file before/after editing. No ``targets`` → repo dashboard, led by a ``directive`` naming the one file
to fix first. With ``targets`` → per-file scores + findings. Rank by
``weighted_deficit`` (score-points x NLOC), not ``score``, which floors at
1.0; ``share_of_repo_gap_pct`` is the same quantity as a percentage.
Per file: ``score`` is defect risk *and* the headline — there is no
``defect_score`` — beside ``maintainability_score`` / ``performance_score``
(never blended in).
Args:
targets: file paths or ``module:<name>``. Empty → dashboard. A target
matching nothing is named in ``unresolved`` with a reason (so empty
``findings`` means healthy); it survives any ``only``.
include: ``biomarkers`` | ``refactoring`` | ``trend`` | ``coverage`` |
``accuracy`` | ``signals`` | ``churn_complexity`` |
``performance``/``defect``/``maintainability`` (dimension). Only
*adds*, and the ranked lists compose — pair with ``only``, e.g.
``include=['refactoring'], only=['refactoring_plans']``. Over-cap
responses are trimmed (``_meta.truncated_to_fit``).
only: keep just these top-level keys; ``["directive"]`` is cheapest and
``*_total`` siblings survive. Only the three block names
alias (``biomarkers``/``accuracy``/``refactoring``); the dimension
names ``performance``/``defect``/``maintainability`` and ``signals``
do not, and land in ``unknown_only_keys``.
repo: usually omitted.
limit: max rows per ranked list (max 50, ``0`` for none).
|
| get_overviewA | Architecture map for an unfamiliar repo — first call when you don't know your way around. Returns the synthesised overview plus the wiki outline (the stored page
tree, top rung), key modules, entry points, repo-wide git health (hotspot
count, churn trend, bus-factor distribution), the knowledge map (top
owners, knowledge silos), and the community summary.
Skip this on subsequent calls — once you have the map, jump straight to
``get_context`` / ``get_answer``.
Compact by default: ``content_md`` carries only the overview essay's summary
section — the rest of the essay repeats ``key_modules`` / ``entry_points`` /
``architecture.layers``. Pass ``include=["content"]`` for the full essay.
In workspace mode:
- Omit ``repo`` for the default repo's overview plus a workspace footer.
- ``repo="all"`` returns the cross-repo topology (co-changes, package deps,
API contracts) — no single-repo detail.
- ``repo="<alias>"`` targets one specific repo.
Args:
repo: Repository alias, path, or ID. Use ``"all"`` for workspace overview.
include: Opt-in extras. ``"content"`` returns the full overview essay in
``content_md`` instead of the compact summary section. ``"outline"``
expands the page tree one rung deeper (modules under their layer).
|
| get_riskA | What history says about touching these files — bug fixes, churn, owners. Fuses git temporal signals (churn percentile, trend, bus factor) with
graph topology (dependents, co-changes, impact surface) and security
findings. Consult before editing a bug-fixed or busy file. Pass
changed_files for PR mode: the response leads with a directive block
(will_break, missing_cochanges, missing_tests, tests_to_run) — read it
first. tests_to_run is coverage-backed: the tests the per-test map proves
exercise the changed files, empty when no coverage map is ingested. To
score a commit or ``base..head`` range instead, use ``get_change_risk``.
defect_profile appears only on files with counted bug fixes: how many landed
in the trailing 6 months, how long ago the last one was, a bug_magnet flag
for sustained recent fix pressure, and top_symbols. Read top_symbols as
"mostly here" rather than exact — symbol spans are current-tree while each
fix's line ranges are numbered on its own parent commit. Nothing names the
commit that introduced a bug. global_hotspots ranks the same way: fix
history first, churn as fallback.
episodes counts the dated records bound to a target — what happened here and
why, evidenced by a commit or a filesystem fact. It appears only when there
is at least one, and get_why serves the bodies. A directory target
aggregates everything beneath it, so compare the numbers within a kind of
target, not across kinds.
Args:
targets: file paths to assess.
repo: usually omitted.
changed_files: PR-changed files for blast-radius mode.
|
| get_symbolA | Follow-up read of one symbol whose id another response already gave you. **Not an entry point.** ``get_answer`` already ships ``symbol_bodies``, and
for a whole file ``get_context(include=["skeleton"])`` or a plain Read is
one call instead of many. Reach here for a body that was elided, or for a
``continuation`` / omission ref. Never walk a file symbol by symbol.
Raw source of one indexed symbol, bounded (~600 lines). ``source`` uses
Read's exact line-numbered format; treat it as an already-performed Read.
``verified: true`` = bounds checked (or corrected) against the live file:
no follow-up Read needed. ``bounds: "approximate"`` = the symbol moved and
re-location failed. An ambiguous id (overloads, re-exports) returns ALL
matching bodies in ``candidates``; none is silently chosen. Also serves
live range reads ("path.py:140-180", ≤200 lines, always verified) and
omission refs ("repowise#<12-hex>"). An index miss returns fallback_lines
from a live grep rather than a dead end. When ``truncated`` is true the
response carries a ``continuation`` token: the exact range read that
fetches the remainder; pass it straight back to get_symbol.
Args:
symbol_id: "path/to/file.py::Name", "path/to/file.py:140-180" for a
live range, or an omission ref.
context_lines: extra lines before/after (0-50).
repo: usually omitted.
query: omission refs only, regex/substring filter on lines.
id: accepted alias for ``symbol_id``.
depth: 1 (default) is this symbol alone; 2-3 also returns the bodies
it calls, transitively, in ``callee_bodies``.
|
| get_whyA | Why this code is shaped this way — decision records + evidence commits. Call before refactors or pattern divergences. Query modes: a question
("why is auth using JWT?"), a file path (governing decisions + origin
story + alignment score), a question anchored to targets, or no query
(decision health dashboard). Falls back to git archaeology when no
decisions exist for a path — never empty.
Args:
query: question, file/module path, or omit for the dashboard.
targets: optional file paths to anchor the search.
repo: usually omitted.
|
| list_reposA | List repos available through this MCP server. In workspace mode this returns every configured workspace repo alias. Use
those aliases as the ``repo`` parameter on workspace-aware tools.
|
| search_codebaseA | Find code by concept, symbol, or path — hybrid codebase search. For QUESTIONS ("how does X work", "where is Y handled", "why is Z like
this"), call get_answer instead: it runs this same hybrid retrieval
internally and synthesizes a cited answer, so searching first is a wasted
round-trip. Use this tool when you want the raw ranked hits themselves —
enumerating matches, resolving an identifier to a symbol_id, or scoping a
later get_context call.
mode="auto" (default) routes the query: identifier-shaped queries search
the indexed symbols (returns symbol_id/file/line bounds — pipe into
get_symbol), path-shaped queries resolve files (pipe into get_context),
and conceptual queries run wiki-semantic search. Mixed queries run hybrid,
symbol hits first. Decision records rank below file pages unless the query
is why-shaped.
`candidates` lists up to `limit` distinct openable file paths, best first.
Some results are pages, not files; this is what to Read.
Args:
query: identifier, path, or natural-language query.
limit: max results (default 5).
page_type: restrict to one page type. Common: file_page (per-file
docs, always present) or module_page (subsystem/concept pages).
Any stored type filters (repo_overview, layer_page, scc_page,
api_contract, infra_page, symbol_spotlight).
kind: implementation | test | config | doc (concept/symbol modes).
repo: alias, or "all" for workspace-wide.
mode: auto | concept | symbol | path | hybrid.
symbol_kind: filter symbol hits by kind (function|class|method|...).
|