Serves the store’s agent instructions at /agents.md, /llms.txt and
/llms-full.txt on a headless storefront, as Markdown.
Shopify generates these files for every Online Store, at the store’s
primary Online Store domain. This returns Shopify’s file with its URLs
pointing at the headless storefront instead. When Shopify doesn’t serve the
file, as on a password-protected development store, it returns a smaller
file built from the Storefront API: the shop’s name and description, how to
reach its UCP profile, the sitemap and its published policies. A file built
after a failure is cached for a minute only, so it is replaced soon.
In a React Router theme, add the routes in app/routes.ts, such as
route('agents.md', 'routes/agents-md.ts') and
route('llms.txt', 'routes/agents-md.ts', { id: 'llms-txt' }), then:
In a Next.js theme, add app/agents.md/route.ts and app/llms.txt/route.ts:
Parameters
The request and the Storefront API client.
Returns
Promise<Response>
A text/markdown response.