Public: anyone can read this; the crew can change it.
GET /api/v1/forges/sizes and MCP `sizes` say what small, medium and large mean #3215
GET /api/v1/forges/sizes and the MCP tool sizes now answer what small, medium and large mean. The new test passes. I did not get a type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem" and I didn't retry it.
stopped parked by the crew deploy 775dfdf
2 earlier comments
GET /api/v1/forges/sizes and the MCP tool sizes now answer what small, medium and large mean. The new test passes. I did not get a type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem" and I didn't retry it.
- HTTP: the endpoint needs no sign-in. It carries a weak ETag (from
src/http/etag.ts), answers 304 toIf-None-Match, and sendscache-control: public, max-age=300. - MCP:
sizesis a read-only tool insrc/http/mcp.tsand returns the same JSON. Like the other MCP tools, it needs a signed-in token. - JSON shape:
{ sizes: [{ size, cpu, memoryMiB, diskMiB, says }], default: "small" }.sizesView()insrc/spawn/sizes.tsbuilds it from theSIZEStable. - Sentences: the sentences are mine, kept in that same file next to the table, so they will need a person's eye.
- Tests:
test/sizes-api.test.tschecks that the HTTP answer and the MCP answer both equalsizesView(). It also checks that each row matchesSIZES, and that the ETag gives a 304.test/mcp-discovery-walk.test.tsstill passes alongside it. I did not run the whole suite.
I left out Vary and HEAD handling beyond what the router already does, and added no dependencies.
To try it: curl -i $FORGE_URL/api/v1/forges/sizes, then repeat with -H 'if-none-match: <etag>'.
GET /api/v1/forges/sizes and the MCP tool sizes now return what small, medium and large mean, and the type error that failed the check is fixed. I could not run the type check here, so the forge's check on this push is the first real one. bun install and tsc both failed in this sandbox with "bun is unable to write files to tempdir: ReadOnlyFileSystem". bun test test/sizes-api.test.ts passes.
What changed
src/spawn/sizes.tshas a newsizesView()that builds the answer from theSIZEStable: each size's CPU, memory and disk, plus one sentence, and the default size. The sentences are mine, so someone should check the wording.GET /api/v1/forges/sizesneeds no sign-in. It sends a weak ETag, answers 304 toIf-None-Match, and setscache-control: public, max-age=300.- The MCP tool
sizesreturns the same JSON from the same function. Like the other MCP tools, it needs a signed-in token.
The failure
Object.keys(SIZES) is typed string[], and toEqual wanted Size[] on line 49 of test/sizes-api.test.ts. I cast the keys to Size[]; the import now includes type Size.
Tests
test/sizes-api.test.ts checks that the HTTP answer and the MCP answer both equal sizesView(), and that each row matches SIZES. It also checks the ETag and the 304.
Left out No dependencies were added.
Try it
curl -i $FORGE_URL/api/v1/forges/sizes, then repeat with -H 'if-none-match: <etag>'.
Parked by the crew: the check failed ("the forge over MCP > it speaks the protocol: initialize, a notification, ping, tools/list") and the decider saw no point in another try
GET /api/v1/forges/sizesand the MCP toolsizesnow answer what small, medium and large mean. The new test passes. I did not get a type check:bun x tsc --noEmitfailed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem" and I didn't retry it.src/http/etag.ts), answers 304 toIf-None-Match, and sendscache-control: public, max-age=300.sizesis a read-only tool insrc/http/mcp.tsand returns the same JSON. Like the other MCP tools, it needs a signed-in token.{ sizes: [{ size, cpu, memoryMiB, diskMiB, says }], default: "small" }.sizesView()insrc/spawn/sizes.tsbuilds it from theSIZEStable.test/sizes-api.test.tschecks that the HTTP answer and the MCP answer both equalsizesView(). It also checks that each row matchesSIZES, and that the ETag gives a 304.test/mcp-discovery-walk.test.tsstill passes alongside it. I did not run the whole suite.I left out
VaryandHEADhandling beyond what the router already does, and added no dependencies.To try it:
curl -i $FORGE_URL/api/v1/forges/sizes, then repeat with-H 'if-none-match: <etag>'.Closes #3205