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

llms.txt, the MCP server card and tools/list name the same number of tools a stranger can sign in for #15874

Merged opened this

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

Merged

llms.txt's "N more tools with an account" line now takes its number from moreAfterSignIn(ssh) in src/core/mcpcard.ts, the same function the server card's line uses. Today's code counted every tool, including the SSH-only sshkeys, so it drifted from the card by one when the terminal is off.

Notes

shipped production is serving it deploy 3fede26

opened this

llms.txt's "N more tools with an account" line now takes its number from moreAfterSignIn(ssh) in src/core/mcp_card.ts, the same function the server card's line uses. Today's code counted every tool, including the SSH-only ssh_keys, so it drifted from the card by one when the terminal is off. The new test and test/mcp-size.test.ts pass, and so does test/agent-card.test.ts; tsc is clean and the gate rewrapped comments, which are committed. The forge's full check hasn't run on this push yet.

What changed

  • src/web/llms_tools.ts: mcpToolsSection calls moreAfterSignIn(ssh) instead of counting all.length - free.length itself.
  • Cache key: I also made the stranger's kept-body key include the terminal state, because it was just anon. After the terminal was toggled, llms.txt would have kept serving the old count.
  • test/tool-count-agree.test.ts: for terminal on and off, it checks that llms.txt's number equals the server card's tools.count minus the anonymous tool count. That count comes from TOKEN_FREE_TOOLS.length, so the test does not call anonymous tools/list over HTTP. It fails on the old code with the terminal off.

Not done: no new tool, no raised ceiling. I did not hit production to compare the three live documents.

How to try: bun test test/tool-count-agree.test.ts test/mcp-size.test.ts. On a preview, the number on the "more tools with an account" line in /llms.txt should equal tools.count in /.well-known/mcp-server-card.json minus 7.

The pre-push hook refused the first push until a commit carried a Try: line. The last commit is an empty one that adds it.

🤖 Generated with Claude Code

Closes #15869

commented

<!-- look-pages c91de708e9bb --> Look pages for c91de70, from the gate:

  • look pages (inferred): this pull changes src/web/llms_tools.ts; the forge pictures / (src/web/llms_tools.ts), /docs (src/web/llms_tools.ts), /explore (src/web/llms_tools.ts) and 25 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The look-pages list was inferred only because src/web/llms_tools.ts is imported by many routes. The change alters one number in the plain-text /llms.txt, so no page looks different. I pushed an empty commit whose message starts with No look: and says this, which is the override you described. No code changed in this round, so I did not re-run the tests; the earlier results stand.

What the pull does is unchanged. llms.txt's "N more tools with an account" now comes from moreAfterSignIn(ssh), the same function the server card uses. The anonymous llms.txt cache key now includes the terminal state. test/tool-count-agree.test.ts covers terminal on and off.

Try: open /llms.txt on the preview. The number on the "more tools with an account" line should equal tools.count in /.well-known/mcp-server-card.json minus the 7 token-free tools.

🤖 Generated with Claude Code

Approved

Preview checked: /llms.txt says 195 more tools; the server card says tools.count 202; 202 - 7 token-free = 195. llms_tools.ts now calls moreAfterSignIn(ssh) and the anonymous cache key includes the terminal state, so a terminal-on and terminal-off reader no longer share a body. No page markup changed, so the design rules are not touched. Next, two things: (1) make the test read the real anonymous tools/list length and tools.count rather than TOKEN_FREE_TOOLS.length and tools.length, so it matches box 2 literally; (2) add one assertion that the cached anonymous section differs between ssh on and off when the counts differ, to pin the readerKey change.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs