> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router 7 or 8 (Pilot uses 8): import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Before using any code sample, read `@weaverse/hydrogen` in the project's `package.json`: 6.x and 5.x import from different entries and use different type names, so code for one does not build on the other.
> `@weaverse/hydrogen` 6 (Shopify Hydrogen 2026.10 and later, the version these docs show) imports from `@weaverse/hydrogen/react-router` and uses `Weaverse*` types such as `WeaverseComponentProps`, `WeaverseComponentLoaderArgs` and `WeaverseComponentSchema`; the root `@weaverse/hydrogen` entry only exports `createSchema()`, data helpers and types.
> `@weaverse/hydrogen` 5.x (Hydrogen 2026.4 and earlier) imports everything from `@weaverse/hydrogen` and uses `HydrogenComponentProps`, `ComponentLoaderArgs` and `HydrogenComponentSchema`. On a 5.x project, convert samples to these names. Upgrade to 6 only when asked (`npx @weaverse/cli@latest migrate v6`, plus the Hydrogen 2026.10 upgrade). Do not mix major versions.
> Next.js themes use `@weaverse/hydrogen` 6.2.0 or later: import client and shared code from `@weaverse/hydrogen/next` and server-only code from `@weaverse/hydrogen/next/server`. `@weaverse/next` is deprecated; never install or import it.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://weaverse.io/docs/developer-tools/weaverse-mcp

# serveAgentsMd

```typescript
serveAgentsMd(options: ServeAgentsMdOptions): Promise<Response>
```

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:

```ts
// app/routes/agents-md.ts
import type { LoaderFunctionArgs } from 'react-router'
import { serveAgentsMd } from '@weaverse/hydrogen/react-router'

export function loader({ request, context }: LoaderFunctionArgs) {
  return serveAgentsMd({ request, storefront: context.storefront })
}
```

In a Next.js theme, add `app/agents.md/route.ts` and `app/llms.txt/route.ts`:

```ts
import { serveAgentsMd } from '@weaverse/hydrogen/next/server'
import { getStorefront } from '@/lib/storefront'

export function GET(request: Request) {
  return serveAgentsMd({ request, storefront: getStorefront() })
}
```

## Parameters

**options** `ServeAgentsMdOptions` *required*

The request and the Storefront API client.

## Returns

`Promise<Response>`

A `text/markdown` response.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.