Skip to content

Pass the example gallery through as published - #564

Merged
abernier merged 1 commit into
mainfrom
claude/examples-passthrough
Aug 12, 2026
Merged

Pass the example gallery through as published#564
abernier merged 1 commit into
mainfrom
claude/examples-passthrough

Conversation

@abernier

Copy link
Copy Markdown
Member

Why

Rendering the gallery here made this server the only way to read it. An agent handed an example's URL β€” pasted into a chat, arrived at from a search, run by a vendor with no pmndrs plugin β€” got HTML and no route to the same text. And pmndrs/examples is a static export, so it could not render one on demand either.

It now writes those documents at build time and links each from its page with rel="alternate" (pmndrs/examples#179). So this server fetches and passes on.

What changes

examples://index and get_example return what the gallery published, verbatim. renderExample, renderIndex, summaryLine, the fence-length logic and the size threshold all move to pmndrs/examples.

βˆ’473 / +117. One rendering, reachable two ways, instead of two that could drift.

What stays is the part that belongs to a server taking a name from a model: that name reaches a URL only if it is the shape a published example has, and index is refused by name because it is legal kebab-case sitting in the same directory.

A coupling that disappears

This server no longer parses any structure from the catalog β€” it fetches text. The shape drift we would otherwise have had to version against (the catalog redeploys on every merge to pmndrs/examples; this deploys on its own schedule) is simply not expressible anymore.

Docs

The agents page now documents both example tools next to the docs ones: the index line format, what the ~23k marker means and why its absence is the useful signal, that an example is a snapshot that pins its own versions β€” and a note that the documents are published, with the rel="alternate" that reaches them without MCP.

Verification

  • pnpm exec vitest run β€” 94 passing; pnpm run lint, pnpm exec tsc --noEmit
  • ran the real route against a real local build of pmndrs/examples served over HTTP: examples://index returns 167 lines with the size markers intact, get_example("spotlight-shadows") returns the published document including its asset attribution, ../../etc/passwd is refused

Order

pmndrs/examples#179 ships first. This branch requests <name>.md, which only exists once that one is deployed; until then it fails with a clear Failed to fetch … Not Found rather than an empty result β€” the behaviour the last route test pins. The .json files it used to read are still there, so nothing breaks in the other direction either.

πŸ€– Generated with Claude Code

Rendering the gallery here made this server the only way to read it. An
agent handed an example's URL, or landing on the page from a search, got
HTML and no way to the same text -- and pmndrs/examples is a static
export, so it could not render one on demand either.

It now writes those documents at build time and links each from its page
with rel="alternate". So examples://index and get_example fetch and pass
on, and the ~470 lines of rendering that lived here are gone: one
rendering, reachable two ways, instead of two that could drift.

What stays is the part that belongs to a server taking a name from a
model -- that name reaches a URL only if it is the shape a published
example has. The agents page now documents both tools.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@abernier
abernier merged commit 2318b88 into main Aug 12, 2026
9 checks passed
@abernier
abernier deleted the claude/examples-passthrough branch August 12, 2026 10:06
@github-actions github-actions Bot mentioned this pull request Aug 12, 2026
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.

1 participant