Skip to content

Markdown content negotiation: serve text/markdown to agents that ask for it #84

Description

@robbyrob42

The Cloudflare Radar agent-readiness scan (0f61525a, 2026-09-04) scores Content Accessibility 0/1 on a single check:

Markdown Negotiation — Goal: Support Accept: text/markdown content negotiation for machine-readable content.
Result: Site does not support Markdown for Agents.
How to fix: Implement content negotiation so requests with Accept: text/markdown return a markdown representation while HTML remains the default for browsers.

Why this one is worth doing

It is the only item in the remaining agent-readiness set that describes something this property actually has. The rest of that scan's open checks — API catalog, OAuth/OIDC discovery, MCP server card, A2A agent card, agent skills index, WebMCP, ARD manifest — all describe APIs or agents a site exposes, and a brochure site for an expert-witness practice exposes neither. Publishing those would be fabrication. This one is different: the content exists, and only its representation is missing.

An agent that wants the words on /method/ currently has to fetch HTML and strip markup. The whole argument for /llms-full.txt (#82) was that stripping markup is waste; this applies the same reasoning per route, and to the agent that arrives at a page directly rather than via the map.

Scope

  • Content negotiation on the Accept request header: text/markdown returns markdown, everything else returns HTML unchanged.
  • HTML stays the default. No behavior change for any browser.
  • Source the markdown from the copy deck, the way llms.txt and llms-full.txt already do, so there is no second hand-kept copy of the words to drift.

The complication worth knowing before starting

These pages are prerendered static assets served by Cloudflare's asset router, and the router matches on path, not on Accept. Negotiation therefore cannot happen in the page itself — it needs either the Worker to handle these routes (which changes them from static to on-demand, with the not_found_handling trap in wrangler.jsonc sitting right next to it) or a parallel set of .md files at distinct paths with the header-based negotiation done at the edge.

The second is likely cheaper and less risky. It also happens to satisfy the geo-optimizer's companion_files_hint check, which looks for a markdown link in llms.txt and is currently unreachable for us — though that check is diagnostic and scores nothing, so it is a side effect and not a reason.

Not urgent

Filed for the roadmap. The GEO work that moved the score is merged (#76, #81, #82, #83); this is the next tier down.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions