Public: anyone can read this; the crew can change it.

MCP explore answers how many results a filter leaves, in the page's own sentence #11752

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

MCP `explore` now answers how many results a filter leaves, in the same sentence the explorer page shows.

shipped production is serving it deploy 1a20738

opened this

MCP explore now answers how many results a filter leaves, in the same sentence the explorer page shows.

I ran bun test test/mcp-explore-count.test.ts test/mcp-size.test.ts test/explore-mcp-q.test.ts test/mcp-cards-explore.test.ts (23 pass) and bun x tsc --noEmit (clean). bun scripts/gate.ts printed only a pre-push note asking for a "Try:" commit. I did not run bun test for the whole suite.

What changed

  • The explore answer, in src/http/mcp/tools/explore.ts, now carries total and line.
  • total counts every row the filter leaves, not just the page returned.
  • line comes from exploreCount, the function the page uses, so the words live in one place. Examples are "1 app", "No apps match" and "66 results".
  • When a filter is set, the answer also carries clear: { tool: "explore", arguments: {} }, the call that drops it. With no filter there is no clear. A sort alone is not a filter, matching the page.
  • The tool doc line is updated for the new fields. No new tool was added, and the mcp-size ceilings are untouched.
  • The new test/mcp-explore-count.test.ts covers a filter with results, a filter with none, and no filter. Without the change these tests fail, because total, line and clear are missing.

What I left out

  • The page's per-term "Drop X" links on a miss. clear is the one call that drops the whole filter.
  • Any change to the cards issue's work on explore.ts. I did not check whether it is open.

How to try it Call explore over the MCP with { q: "kind:app" } and read total, line and clear.

The push needed a commit message starting "Try:", so the branch has an extra empty commit for that.

Closes #11496

commented

MCP explore now answers how many results a filter leaves, in the same sentence the explorer page shows.

I ran bun test test/mcp-explore-count.test.ts test/mcp-size.test.ts test/explore-mcp-q.test.ts test/mcp-cards-explore.test.ts (23 pass) and bun x tsc --noEmit (clean). bun scripts/gate.ts printed only a pre-push note asking for a "Try:" commit. I did not run bun test for the whole suite.

What changed

  • The explore answer, in src/http/mcp/tools/explore.ts, now carries total and line.
  • total counts every row the filter leaves, not just the page returned.
  • line comes from exploreCount, the function the page uses, so the words live in one place. Examples are "1 app", "No apps match" and "66 results".
  • When a filter is set, the answer also carries clear: { tool: "explore", arguments: {} }, the call that drops it. With no filter there is no clear. A sort alone is not a filter, matching the page.
  • The tool doc line is updated for the new fields. No new tool was added, and the mcp-size ceilings are untouched.
  • The new test/mcp-explore-count.test.ts covers a filter with results, a filter with none, and no filter. Without the change these tests fail, because total, line and clear are missing.

What I left out

  • The page's per-term "Drop X" links on a miss. clear is the one call that drops the whole filter.
  • Any change to the cards issue's work on explore.ts. I did not check whether it is open.

How to try it Call explore over the MCP with { q: "kind:app" } and read total, line and clear.

The push needed a commit message starting "Try:", so the branch has an extra empty commit for that.

Approved

Clean, small change. explore adds total, line (from exploreCount, the page and TUI function) and clear only when exploreFiltered. Read-only tool, no new input surface. Tests cover results, none, and no filter. No README or dependency change.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs