Skip to content

Add generated tool reference doc with CI guard - #407

Merged
tw-garymeehan merged 1 commit into
mainfrom
gary/tool-reference-generator
Jul 24, 2026
Merged

Add generated tool reference doc with CI guard#407
tw-garymeehan merged 1 commit into
mainfrom
gary/tool-reference-generator

Conversation

@tw-garymeehan

Copy link
Copy Markdown
Contributor

What

Adds cmd/docs-gen, a generator that reflects over the registered MCP toolsets and emits docs/tool-reference.md — a per-toolset CRUD matrix covering all four products (Projects, Desk, Spaces, Chat). No token or live server needed; it reads only static tool metadata (nil engine/HTTP client), so it's hermetic.

The tool reference is now linked from the README.

Accuracy: deletes are intentionally omitted

Delete tools exist in the codebase but are gated behind allowDelete, which no shipped server enables (cmd/mcp-http and cmd/mcp-stdio both pass false, and there's no flag/env to flip it). Showing deletes as available would mislead readers, so the generator builds groups with allowDelete=false to mirror exactly what a client receives. The header note explains this.

Self-policing in CI

Guard tests ride the existing go test ./... workflow (no new Actions file):

  • Golden — committed doc must equal generator output (catches ordinary tool add/remove/rename).
  • Bijection — every registered tool renders exactly once (matrix cell or "Other actions"); nothing silently dropped or duplicated.
  • Annotation cross-check — Get/List columns must be ReadOnlyHint=true, Create/Update must be false (catches a mis-verb-named tool in the wrong column).
  • No-delete + a gated-existence counterpart proving the guard isn't vacuous.

A -check flag verifies the committed doc locally: go run ./cmd/docs-gen -check.

Known manual triggers (documented in AGENTS.md)

A golden check enforces "doc matches generator," not "doc matches reality." Two changes CI cannot auto-detect, now called out in AGENTS.md:

  1. Flipping allowDelete to true on a shipped server.
  2. Adding a new product package (must be registered in products()).

Test plan

  • gofmt -l, go vet ./cmd/docs-gen, go build ./... — clean
  • go test ./cmd/docs-gen — all 5 guards pass
  • go run ./cmd/docs-gen -check — exits 0 (doc current)

🤖 Generated with Claude Code

Add `cmd/docs-gen`, a generator that reflects over the registered MCP
toolsets and emits `docs/tool-reference.md` — a per-toolset CRUD matrix
covering all four products (Projects, Desk, Spaces, Chat). It requires no
token or live server; only static tool metadata is read.

The doc mirrors what shipped servers actually expose: groups are built
with allowDelete=false, so delete operations (which exist in code but are
gated off in every shipped server) are intentionally omitted rather than
shown as available.

Guard tests ride the existing `go test ./...` CI:
- golden check (doc matches generator output)
- bijection (every tool renders exactly once, nothing silently dropped)
- annotation cross-check (Get/List => ReadOnlyHint, Create/Update => not)
- no-delete guard, plus a gated-existence counterpart
A `-check` flag verifies the committed doc locally.

AGENTS.md documents the two changes CI cannot auto-detect (flipping
allowDelete on a shipped server, or adding a new product package).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tw-garymeehan
tw-garymeehan requested a review from a team as a code owner July 24, 2026 13:56

@rafaeljusto rafaeljusto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@tw-garymeehan
tw-garymeehan merged commit ed6c6f0 into main Jul 24, 2026
3 checks passed
@tw-garymeehan
tw-garymeehan deleted the gary/tool-reference-generator branch July 24, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants