Brick Work

0017. API v2: v1's resources with the 4.0 identity, an MCP that takes numbers

Context

Schema 4.0 (0016) gives every item a Brick Work id, so v1's addressing by BrickLink (item_type, item_no) no longer names an item. A BrickLink number can name several items: n:m mappings, colour-scoped legs, merged items. v1 had two clients, Toni through the House API and the lego-add skill, plus the MCP server that is generated from the contract. All of them speak BrickLink numbers. Design § 7 sets the frame (paths by Brick Work id, number lookups, v1 answers 410) and leaves the conventions open.

Options considered

  1. A redesigned v2. New resources, envelopes and error codes, shaped around 4.0. Every client is rewritten, and the work is a milestone of its own.
  2. v1's resource set with the 4.0 identity. Envelopes, pagination, filters, ETag and If-Match, idempotency, error codes, scopes and tokens stay as in api-v1.md § 2. Only the way an item is named changes, so a client changes only that.
  3. Keep v1 by translating numbers to ids at the edge. Ambiguous numbers have no correct answer, and a merged id would silently move a write.

Recommendation: 2. Two clients, both already on the v1 conventions, and the § 7 table lists every change.

Decision

v2 is v1's resource set with the 4.0 identity.

Amendment of 2026-11-08: the wishlist tool names

The rule "it keeps its tool names" is broken once, on purpose, before v1.0.0. The five wishlist tools carried names generated from their method and path; every other tool has a name that says what it does. The maintainer decided on 2026-11-08: "Clean rename before v1.0.0" (#152), with no aliases.

Before (0.9.0) From the next release
post_wishlists create_wishlist
patch_wishlists_id edit_wishlist
delete_wishlists_id archive_wishlist
post_wishlists_id_restore restore_wishlist
post_wishlists_id_transfer transfer_wishes

Their descriptions (the operations' summary) changed with them. The REST API, its operation ids and every other tool are unchanged. This breaks an MCP client that calls a wishlist tool by its 0.9.0 name: it gets "unknown tool" and must use the new name. The release notes say so. From v1.0.0 on, the rule stands again: a tool name changes only with a new major version.

Consequences

#113, docs/brickwork/api-v2.md § 2 (§ 2.10 holds every correction), docs/brickwork/openapi-v2.yaml, docs/brickwork/mcp.md; 0006, 0007, 0016.