Agent Wranglers

Ready for AI agents Recommended

Publish each page's data as a file

Publish each page's JSON-LD (structured facts) in the page and as its own file. Then agents can read the facts without parsing HTML.

How to do it

Write each page's JSON-LD graph to a file at build time. Serve it at /page.jsonld with application/ld+json. Link it with <link rel="alternate" type="application/ld+json">.

Example

<link rel="alternate" type="application/ld+json" href="/services.jsonld">
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"Service","name":"Roof repair","provider":{"@type":"Organization","name":"Example Co","url":"https://example.com/"}}
</script>

How to check

A test parses the embedded graph and the file for every page. They are identical, and both pass a validator such as validator.schema.org.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/ready-for-ai-agents/structured-data-for-agents.