agents.md.liquid
The agents.md.liquid template renders the agents.md file, which is hosted at the /agents.md URL.
The agents.md file is the canonical, agent-facing description of a store. It tells AI agents and shopping assistants how to discover the store's commerce capabilities and how to transact with it, including:
- The store's Universal Commerce Protocol (UCP) discovery and Model Context Protocol (MCP) endpoints.
- Read-only browsing URLs for product, collection, and search data.
- The store's published policies.
- Guidance for personal shopping agents, such as the Shop skill.
Shopify generates an agents.md file by default, which works for most shops, so this template isn't included in any themes by default.
The agents.md file is served at the bare primary domain, without a locale or Shopify Markets subfolder prefix. It has no localized counterpart.
The agents.md file is served at the bare primary domain, without a locale or Shopify Markets subfolder prefix. It has no localized counterpart.
agents.md is the canonical agent-discovery document. The /llms.txt and /llms-full.txt URLs are alternate URLs that mirror the content of /agents.md by default on Shopify stores, so agents that request either one still find a usable document.
Because of this, the agents.md.liquid template is the fallback for all three URLs. When a request is served, Shopify looks for a theme template in the following order, and uses the first one it finds:
| URL | Template lookup order |
|---|---|
/agents.md | agents.md.liquid → Shopify-generated default |
/llms.txt | llms.txt.liquid → agents.md.liquid → Shopify-generated default |
/llms-full.txt | llms-full.txt.liquid → agents.md.liquid → Shopify-generated default |
This means that if you add only an agents.md.liquid template, then it's used for all three URLs. To make one of the llms URLs diverge, add a dedicated llms.txt.liquid or llms-full.txt.liquid template — it takes precedence for that URL only, while the others keep mirroring agents.md.
Anchor to LocationLocation
The agents.md.liquid template is located in the templates directory of the theme:
If your theme doesn't already contain the agents.md.liquid template, then you can add it with the following steps:
Desktop
-
From your Shopify admin, go to Online Store > Themes.
-
Find the theme that you want to edit, and then click ... > Edit code.
Mobile
-
From the Shopify app, tap Store.
-
In the Sales channels section, tap Online Store.
-
Tap Manage all themes.
-
Find the theme that you want to edit, and then tap ... > Edit code.
-
From your Shopify admin, go to Online Store > Themes.
-
Find the theme that you want to edit, and then click ... > Edit code.
- In the left sidebar, locate the Templates folder.
- Right-click on the Templates folder.
- Click New File from the context menu.
- Name the file
agents.md.liquid. - Press Enter to create the file.
Anchor to ContentContent
This template can't be a JSON template. It must be agents.md.liquid.
The template accepts standard Markdown and Liquid. To help you build agent instructions with values that stay in sync with the store's actual commerce configuration, the template exposes an agents object alongside the standard global Liquid objects (such as request and shop).
Anchor to The ,[object Object], objectThe agents object
agents objectThe agents object provides auto-populated UCP and agent-interaction metadata for the store:
| Property | Type | Description |
|---|---|---|
agents.store_name | string | The name of the store. |
agents.store_url | string | The full URL of the store, using the bare primary domain. |
agents.ucp_discovery_url | string | The UCP discovery URL for the store ({store_url}/.well-known/ucp). |
agents.mcp_endpoint_url | string | The MCP (Model Context Protocol) endpoint URL ({store_url}/api/ucp/mcp). |
agents.ucp_versions | array of string | The supported UCP versions, newest first. Derived from the store's UCP implementation, so it stays in sync automatically. |
agents.currency | string | The store's primary currency code, such as USD. |
agents.sitemap_url | string | The store's sitemap URL ({store_url}/sitemap.xml). |
For example:
templates/agents.md.liquid
Avoid outputting potentially private merchant data, such as contact email addresses or phone numbers, in this file. The Shopify-generated agents.md deliberately omits contact details because the file is broadly cached and served to every agent that requests it.
Avoid outputting potentially private merchant data, such as contact email addresses or phone numbers, in this file. The Shopify-generated agents.md deliberately omits contact details because the file is broadly cached and served to every agent that requests it.
Anchor to UsageUsage
When you provide an agents.md.liquid template, it replaces the Shopify-generated agents.md and, unless overridden, the content served at /llms.txt and /llms-full.txt.
It's strongly recommended to keep the UCP and MCP endpoints discoverable by using the agents object rather than hardcoding URLs. The auto-populated values stay in sync as the store's commerce configuration changes.