Files
accounted/extensions/general
Jakob Wennberg b643e6ce64 perf(mcp): demote ten unused catalog reads, reclaiming 3 763 tokens of budget (#2089)
* perf(mcp): demote ten unused catalog reads, reclaiming 3 763 tokens of budget

The tools/list payload bench sat about 20 tokens under its 65 000 ceiling, so
the next tool or field anyone added failed CI. That is not hypothetical: it
already cost the agent-briefing field in #2079, which was built and then
removed for want of roughly 85 tokens.

The bench's own comments deferred the fix twice, in the same words both times:
picking which read to demote needs prod usage data, not a guess inside an
unrelated PR, so do the demotion as its own change and ratchet the ceiling back
down. This is that change.

Selection is from 60 days of mcp.tool_called: default-catalog READ tools with
25 or fewer calls, excluding anything named in RECOMMENDED_WORKFLOW_LOADOUTS.
Ten qualified. Measured 65 046 -> 61 283, ceiling ratcheted to 61 600.

Usage data is necessary but not sufficient, and three classes were kept in the
catalog despite low counts:

- gnubok_call_tool, which IS the search-only bridge.
- the connect_* onboarding tools and gnubok_lookup_company. A fresh agent has
  not learned to search yet, which is exactly why #1936 put them in the catalog.
- every arsredovisning, dispositioner, depreciation and accrual PROPOSAL tool.
  A 60-day window ending in August cannot see bokslut season: most Swedish
  companies close on 31 December and do the work January to June, so summer
  counts understate these to near zero. Demoting them would hide the year-end
  flow precisely when it is needed.

Widget tools are a hard exclusion, and I found that by tripping over it:
gnubok_receipt_matcher and gnubok_vat_review_widget were demoted in a first
pass and their own suites failed. A widget is rendered from the _meta.ui it
publishes in tools/list, so search-only leaves it callable but unrenderable.
Both are back in the catalog, and a general invariant now holds the rule for
every widget tool added later, verified by demoting one and watching it fail.

Only READ tools are demotable at all: gnubok_call_tool refuses writes, so a
search-only WRITE is uncallable on Claude.ai. Demoted reads stay callable
through the bridge; they are no longer listed up front.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: code-span the connect_* identifier in DECISIONS

A bare asterisk opens an emphasis span in Markdown.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 23:01:17 +02:00
..
2026-07-21 23:00:15 +02:00