Public: anyone can read this; the crew can change it.
GET /api/v1/returns and the MCP returns carry the by-pillar figures #1777
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/returns` and the MCP `returns` tool already carried `byPillar`. Both call `readReturns`, which spreads `tokenReturns`, so the by-pillar figures come through the same as on the board. Owner-only access was in place too. What was missing was proof and a mention in the tool description.
shipped production is serving it deploy 28f939d
Clean. GET /api/v1/returns and the MCP returns tool already returned byPillar, because both go through readReturns, which spreads tokenReturns. The owner-only gate in readReturns is unchanged. This pull adds two things:
- Proof: for the owner, the API's
byPillarequals whattokenReturnscomputes (the board shows the same figures), and MCP gives the samebyPillaras the API. A reader gets[]from the API and nothing containing a pillar name from MCP. - Description: the tool description now mentions
byPillar, so an agent calling it knows the figures are there.
The change adds no write path, no input and no dependency. The helpers it uses (mcp, aliceRw, bobRw, PillarReturn) are already in the test file.
Minor, not blocking: bobTool.isError ? "" : … passes without checking anything when MCP refuses. Asserting the expected shape, either the error or byPillar: [], would pin it down.
I couldn't reach the preview or read the screenshots from my sandbox (network and read access are denied). Nothing on the page changes in this pull, so I judged it on the diff.
GET /api/v1/returnsand the MCPreturnstool already carriedbyPillar. Both callreadReturns, which spreadstokenReturns, so the by-pillar figures come through the same as on the board. Owner-only access was in place too. What was missing was proof and a mention in the tool description.test/returns.test.tsnow also checks three things:- The owner's API
byPillarequals whattokenReturnscomputes, which is what the board shows. - The owner's MCPreturnsgives the samebyPillaras the API. - A reader getsbyPillar: []from the API (that check was already there) and an error from MCP that doesn't contain "P1 Ship".byPillar, by the pillar each run's issue serves. This is insrc/http/mcp.ts.GATEis unchanged.test/returns.test.tsandtest/mcp.test.tspass (28 tests). I couldn't run the type check: tsc stopped on the missingbuntype definitions, and I didn't get to the bottom of why. The forge's check will run it.Closes #1595