---
title: Markdown Negotiation
description: Returns a Markdown representation when an agent requests `Accept: text/markdown` while keeping HTML as the default for browsers.
author: percio
version: 1.0
---

This skill enables content negotiation for agents requesting `text/markdown`.

Behavior:
- If the incoming request includes an `Accept` header containing `text/markdown`, the origin HTML is converted to Markdown and returned with `Content-Type: text/markdown`.
- The response includes an `x-markdown-tokens` header with a simple token estimate (word count) when available.

Deployment:
- Deploy the companion Cloudflare Worker located in `cf-workers/agent-discovery-worker.js` to your Cloudflare account and attach it to your site route (e.g. `perciocastelo.com.br/*`).

Docs:
- Cloudflare "Markdown for Agents": https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/
