Skip to content

fix(tools): Rank tool search on tool text and skip direct tools - #2894

Merged
dcramer merged 1 commit into
mainfrom
fix/tool-search-ranking
Nov 7, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/tool-search-ranking

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Covers recommendations 1–3 from #2893. searchTools matched every tool in a source for almost any query and returned direct tools the model already had.

  • Stop indexing the source description. It is the same text on every tool in a source, so words like "issue" and "pull request" matched all 16 GitHub tools.
  • Index parameter names and descriptions instead of raw schema and annotation JSON, which added type, string, and properties to every tool.
  • Fold common plurals on both sides, so "issues" finds getIssue and "repositories" finds getRepository. Before, "repositories" matched nothing.
  • Drop matches that score below 30% of the best match.
  • Leave direct tools out of results and the source list. executeTool can still run them.
  • Remove exposure from result entries. Every result is now deferred.

Checked against the real GitHub plugin tools with source: "github", PR tools direct as in production:

  • "comment on issue": 16 matches, commentOnPullRequest first, 5.7k chars → 4 matches, commentOnIssue first, 3.6k chars
  • "create issue": 16 matches → 1 (createIssue)
  • "clone repository": 16 matches → 1 (cloneRepository)
  • "repositories": 0 matches → getRepository first

Remaining payload size is mostly input_schema. Recommendation 4, compact results, is left for a follow-up. It changes the searchTools → executeTool contract and the Code Mode hint, so it should ship together with, or after, a decision on loading found tools directly (recommendation 7).

Refs #2893

via @dcramer.

--

View Session [Sentry]

Stop indexing the source description and raw schema JSON, which matched
every tool in a source. Index parameter names and descriptions instead,
fold common plurals, drop matches far below the best score, and leave
direct tools out of results since the model already has them.

Refs #2893

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 7, 2026 6:26pm UTC

Request Review

@blacksmith-sh

This comment has been minimized.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

8 screenshot changes — 8 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Captured Memories Popover · Mobile
Conversation Captured Memories Popover · Mobile
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Details Watched Linked Work · Mobile
Conversation Details Watched Linked Work · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Show 2 more changed screenshots
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed
System Cache Share · Desktop
System Cache Share · Desktop
Changed

@dcramer
dcramer merged commit d19fd2c into main Nov 7, 2026
64 of 66 checks passed
@dcramer
dcramer deleted the fix/tool-search-ranking branch November 7, 2026 18:39

This branch was successfully deployed

1 active deployment
Preview – junior-docs — a8a3539b Deployed Nov 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant