News for hackers. Stuff that matters.
Re:Serve Markdown to AI Agents with Accept Headers by k1m on Wednesday August 26, 2026 @09:28PM (#49458280)
In general I think I just don't like the idea of one URL being able to return different content. Forces me to think about what each system I give that URL to may be sending in content negotiation headers. Would rather the HTML is returned and alternatives listed in HTML head.

But for HTML and Markdown in particular, there's been so much useful work done in the semantic HTML space and microformats, that I don't know why anyone interested in this wouldn't just improve their HTML markup and leave it to the agent to do the rest. Convert to markdown or extract the useful HTML before handing it to model.

Re:Serve Markdown to AI Agents with Accept Headers by troupo on Thursday August 27, 2026 @01:04AM (#49459979)
> I just don't like the idea of one URL being able to return different content.

It's different content representations. A text in a markdown file is conceptually the same content as the same text in HTML (or PDF).

Re:Serve Markdown to AI Agents with Accept Headers by spider-mario on Thursday August 27, 2026 @04:39AM (#49461693)
It also means you can’t easily know the set of formats that the server could respond with, which in turns makes e.g. archival more difficult.
Re:Serve Markdown to AI Agents with Accept Headers by 9dev on Thursday August 27, 2026 @05:27AM (#49461992)
That entirely depends on the server. A good solution would be to include Link headers in all responses:

  Link: /some-page      rel="canonical"
  Link: /some-page.json rel="alternate" type="application/json"
  Link: /some-page.html rel="alternate" type="text/html"
  Link: /some-page.md   rel="alternate" type="text/markdown"
Re:Serve Markdown to AI Agents with Accept Headers by _heimdall on Thursday August 27, 2026 @07:15AM (#49462911)
For the LLM use, the challenge is that it will only discover those after first requesting and parsing the HTML version.

Maybe it will notice those, and maybe it will figure out the pattern for follow-up page requests, but there's no guarantee and it won't help the first request.

Re:Serve Markdown to AI Agents with Accept Headers by 9dev on Thursday August 27, 2026 @07:59AM (#49463354)
Not necessarily. They could also send a HEAD request to the URL first, to see the headers only and decide on the available alternates.

I am well aware that few sites are taking that much care of their API in terms of HTTP features, but all of the problems discussed here have solid and battle-tested answers.

Re:Serve Markdown to AI Agents with Accept Headers by _heimdall on Friday August 28, 2026 @01:32AM (#49474715)
The parent was referring to adding `link` tags in the `<head>`, not in HTTP headers.
Re:Serve Markdown to AI Agents with Accept Headers by 9dev on Friday August 28, 2026 @02:32AM (#49475070)
I realised that after posting, but then I suggested sending them as header in the first place.
Re:Serve Markdown to AI Agents with Accept Headers by iamflimflam1 on Thursday August 27, 2026 @06:12AM (#49462370)
That only works if the client looks at it. The current Claude fetch system does not.
Re:Serve Markdown to AI Agents with Accept Headers by 9dev on Thursday August 27, 2026 @08:03AM (#49463384)
Should we let vibe-coded agent harnesses dictate protocol design now..?

On the flip side, I'd argue that the current centralisation of user agents (in the classical sense here) that benefit from programmatic content negotiation in form of a handful of harnesses like Claude or Codex is a great lever toward forcing the ecosystem to adopt better practices: If Anthropic added content negotiation as described in this thread to Claude, many sites would be incentivised to improve their web servers.

Re:Serve Markdown to AI Agents with Accept Headers by _heimdall on Thursday August 27, 2026 @07:17AM (#49462935)
The ideas is that the URL references the resource and the content type requested is only asking for that content in a different projection or representation.

The content at a URL should always match, the format in which its represented can be different based on the request. Its a bit like buying a book in hard copy or paperback, same book different format.