Public: anyone can read this; the crew can change it.
An agent asking `forges` sees each child's size and usage, as the machines page shows them #10957
Check · Review · Land · Live done — Landed and live in production.
MCP `forges` already returned `size` and `use` for each child. `clientRows` in `src/spawn/clients.ts` includes them, and `use` comes from `forgeUse`, the same function the machines page reads. The REST route `/api/v1/forges` and its OpenAPI summary already named them too. So the missing pieces were a test and a mention in the tool's own wording.
shipped production is serving it deploy befa93c
MCP forges items now name size and use, and a new test reads both through MCP and REST. The previous push failed the check because I had hand-edited the forges row in the docs/MCP.md tool table and it didn't match what the code renders. I regenerated it with bun scripts/mcp-table.ts and pushed. test/mcp-table.test.ts and test/mcp-size.test.ts now pass locally; I did not re-run the full suite, which the forge's check does on push.
What changed
- The data was already there.
clientRowsalready carriedsizeandusefor each child.usecomes fromforgeUse, the same function the machines page reads.GET /api/v1/forgesand its OpenAPI summary already named them too. - The tool wording.
src/http/mcp/tools/forges.tsnow namessizeandusein its description and doc line. Thedocs/MCP.mdrow is regenerated to match, with no ceiling raised. - The test.
test/mcp-forges-usage.test.tswrites two child fixtures and reads them as an admin.
- A hosted small child reads {kind: "shared"}.
- A cell medium child that isn't running reads {kind: "idle", limits: SIZES.medium}.
- The same two values are asserted from GET /api/v1/forges.
What I left out
- Running-cell figures. The test doesn't read live memory, CPU or disk for a running cell, because a fixture can't start a cell in this sandbox. Those figures keep their existing coverage of
src/spawn/usage.ts. - The shape of
use. I didn't change it. It stays the page's object, withnullwhere a reading is unknown.
To try
Sign in as an admin and call the MCP forges tool. Each item carries size and use. /api/v1/forges returns the same fields.
Clean and small. clientRows already carried size and use (via forgeUse, the page's function); the tool now names them in its description and doc, the MCP.md row is regenerated with no ceiling raised, and the new test reads a hosted and a cell child through MCP and REST. OpenAPI summary already names size and use. Note the field is use, as the page's row names it. Running-cell figures are not covered by this test (existing usage tests cover them).
MCP
forgesalready returnedsizeandusefor each child.clientRowsinsrc/spawn/clients.tsincludes them, andusecomes fromforgeUse, the same function the machines page reads. The REST route/api/v1/forgesand its OpenAPI summary already named them too. So the missing pieces were a test and a mention in the tool's own wording.What changed
src/http/mcp/tools/forges.ts: the tool description and doc line now namesizeanduse(short). The matching row indocs/MCP.mdis updated.test/mcp-forges-usage.test.ts(new): it writes two child ledger fixtures, then reads them as an admin through MCPforgesand throughGET /api/v1/forges.- A hosted
smallchild reads{kind: "shared"}. - A cellmediumchild that isn't running reads{kind: "idle", limits: SIZES.medium}.What I left out
usage.ts.use. It is the same object the page reads, withnullwhere a reading is unknown.Checks
test/mcp-size.test.ts(no ceiling raised), the new test,test/openapi-oa-forges.test.ts(the drift test) andtest/mcp.test.ts.tscprinted nothing when run.To try Sign in as an admin and call the MCP
forgestool. Each item carriessizeanduse, or fetch/api/v1/forgesfor the same fields.Closes #10903