Skip to content

feat(mcp): add get_why to the lean profile; present get_answer as the entry point#889

Merged
RaghavChamadiya merged 1 commit into
mainfrom
feat/mcp-lean-get-why
Jul 17, 2026
Merged

feat(mcp): add get_why to the lean profile; present get_answer as the entry point#889
RaghavChamadiya merged 1 commit into
mainfrom
feat/mcp-lean-get-why

Conversation

@swati510

Copy link
Copy Markdown
Collaborator

Problem

Two salience gaps, both measured by running the lean surface under a real coding agent on a mixed question set:

  1. The lean profile omitted get_why. On why/history questions — the one category a code-search surface cannot answer from the tree alone — the agent had nothing better than file reads and scored measurably below an unassisted baseline. The differentiating tool was configured out, not absent.
  2. Agents routinely paid a search_codebase round-trip before get_answer, even though get_answer runs the same hybrid retrieval internally — the tool descriptions never said so.

Change

  • get_why joins LEAN_TOOLS (~2.1k tokens of schema total, still comfortably always-loadable). Docs updated.
  • get_answer describes itself as the single entry point for questions; search_codebase redirects question-shaped queries there and positions itself for raw-hit use (enumeration, symbol_id resolution, scoping get_context).

Measured effect

With get_why served, the agent used it unprompted on history questions and the why-category score moved from below the unassisted baseline (7.3) to clearly above it (8.8); 21 of 32 runs opened directly with get_answer.

Testing

test_tool_selection.py, test_mcp_docs_drift.py (the drift guard enforced the docs update) — 19 green.

… point

Two salience gaps surfaced by running the lean surface under a real agent
on a mixed question set. First, the lean profile omitted get_why, so on
why/history questions — the one category a code-search surface cannot
answer from the tree alone — the agent had nothing better than file reads
and scored measurably below an unassisted baseline; the differentiating
tool was configured out, not absent. get_why joins the lean set (~2.1k
tokens of schema, still comfortably always-loadable).

Second, agents routinely paid a search_codebase round-trip before
get_answer even though get_answer runs the same hybrid retrieval
internally — the tool descriptions never said so. get_answer now presents
itself as the single entry point for questions, and search_codebase
redirects question-shaped queries there, positioning itself for raw-hit
use (enumeration, symbol_id resolution, scoping get_context).
@repowise-bot

repowise-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

✅ Health: 7.6 (unchanged)

📋 At a glance
3 hotspots touched · 2 files with recent fix history · 1 dead-code finding · no tests touched. Scoped to packages.

🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)

🧪 No test files were touched in this PR — consider adding coverage for the files above.

🔎 More signals (2)

🔥 Hotspots touched (3)

  • .../mcp_server/tool_search.py — 15 commits/90d, 11 dependents · primary owner: Raghav Chamadiya (82%)
  • .../mcp_server/_tool_selection.py — 3 commits/90d, 6 dependents · primary owner: Raghav Chamadiya (100%)
  • .../tool_answer/answer.py — 19 commits/90d, 2 dependents · primary owner: Swati Ahuja (51%)

💀 Dead code (1 finding)

  • 💀 .../tool_answer/answer.py _json_default (confidence 0.65)

📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-17 11:53 UTC
Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot

@RaghavChamadiya
RaghavChamadiya merged commit 843eb5f into main Jul 17, 2026
7 checks passed
@RaghavChamadiya
RaghavChamadiya deleted the feat/mcp-lean-get-why branch July 17, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants