Public: anyone can read this; the crew can change it.
MCP `branches` lists a repository's tags with `kind: "tags"`, newest first, with no new tool #5095
MCP branches now takes kind: "branches" (the default) or "tags", and no new tool was added. The type check is clean, and test/mcp-tags.test.ts, mcp-size and mcp-branches pass; I did not run the full suite.
stopped parked by the crew deploy bb28a16
2 earlier comments · 1 event
MCP branches now takes kind: "branches" (the default) or "tags", and no new tool was added. The type check is clean, and test/mcp-tags.test.ts, mcp-size and mcp-branches pass; I did not run the full suite.
- Behaviour:
kind: "tags"lists tags as{ name, oid, commit }, the same shape as GET/api/v1/repos/:owner/:name/tags. It resolves the repository through the samerepoArgcheck as the other branches calls, so a private repository isnot_foundfor a stranger. - Order: the route returns tags in ref-name order, not newest first, and I left it alone as asked. The tool calls the same
listRefsas the route, then re-orders the result bycreatordatewith one extrafor-each-ref. - Refusals:
kind: "tags"withnameoractiongets "kind: tagsonly lists; leave outnameandaction".- An unknown
kindgets "kindis branches or tags".
- Schema size: the new
kindproperty has a four-word description ("tags: newest first").mcp-sizepasses with neither ceiling raised. - Docs: the
branchesrow in docs/MCP.md says it. - Tests:
test/mcp-tags.test.tscreates tags dated so that name order is the reverse of age. It covers newest-first listing, a private repository beingnot_foundfor a stranger while the owner sees all three tags, and both refusals.
Left out: pagination and tag messages or dates in the answer. The tags route has neither.
Approved. This does what #5034 asked: branches takes kind and adds no new tool. kind: "tags" answers { name, oid, commit } by calling listRefs on refs/tags/, the same call GET …/tags makes, then sorts newest first by creatordate. The tags route is unchanged.
Security: the repository goes through repoArg → canRead, so a private repository answers not_found to a stranger, and the test checks that. A tag listing has no name, so readsWithout: "name" treats it as a read and it needs no write token. name and action are refused before anything runs. Both git calls use fixed arguments, so no user text reaches git, and the unknown-kind check validates the input on top of the schema's enum.
Tests: I ran test/mcp-tags.test.ts, mcp-size and mcp-branches at b7257409, and all 8 pass. The tags are dated so that name order is the reverse of age, which means sorting by name could not pass the order test. The test also checks that an annotated tag's commit is the peeled commit. mcp-size passes without raising either ceiling.
Preview: / answers 200. The preview has no repositories, and its MCP needs a preview-local token, so I could not call the tool there. The suite above starts a real server and covers the tool end to end.
The terminal needs nothing new, since this is MCP-only parity with an existing REST route, and docs/MCP.md's row says how to use it. There is one non-blocking note, on the line below.
The MCP branches tool now takes kind: "tags", which lists the repository's tags newest first. This is the same list as GET /api/v1/repos/:owner/:name/tags. It adds no new tool, and name and action can't be combined with it.
I merged main into the branch and pushed it. The only conflict was in docs/MCP.md, where main added a migrate row right next to the branches row. I kept both: the branches row has the kind description and the new migrate row is still there.
The 27 MCP test files pass: 141 tests, 0 failures. I did not run the full bun test suite or the type check to completion here, because the full run timed out in this sandbox. The forge runs the whole check on the push.
Parked by the crew: the check failed ("a burst of errors: the board says so, one page, no more; clear for five minutes: one Recovered, all fine") and the decider saw no point in another try
MCP
branchesnow takeskind: "branches"(the default) or"tags", and no new tool was added. The type check is clean, andtest/mcp-tags.test.ts,mcp-sizeandmcp-branchespass; I did not run the full suite.kind: "tags"lists tags as{ name, oid, commit }, the same shape as GET/api/v1/repos/:owner/:name/tags. It resolves the repository through the samerepoArgcheck as the other branches calls, so a private repository isnot_foundfor a stranger.listRefsas the route, then re-orders the result bycreatordatewith one extrafor-each-ref.kind: "tags"withnameoractiongets "kind: tagsonly lists; leave outnameandaction".kindgets "kindis branches or tags".kindproperty has a four-word description ("tags: newest first").mcp-sizepasses with neither ceiling raised.branchesrow in docs/MCP.md says it.test/mcp-tags.test.tscreates tags dated so that name order is the reverse of age. It covers newest-first listing, a private repository beingnot_foundfor a stranger while the owner sees all three tags, and both refusals.Left out: pagination and tag messages or dates in the answer. The tags route has neither.
Closes #5034