# AI and LLMs

Serve your docs to AI agents.

Each page has a Markdown version, which an LLM or an agent reads instead of the HTML, and which the [AI plugins](#ai-plugins) read too.

The [recommended preset](/config#recommendedpreset) serves each page's Markdown, `llms.txt` and `llms-full.txt`, like [`/llms.txt`](/llms.txt) and [this page as Markdown](/ai.md) on this site. Without the preset, add `llmsPlugin()`:

```ts title="vuesho.config.ts"
import { createSite, llmsPlugin } from "vuesho/config";
import { defineDocs } from "vuesho/content";

const docs = defineDocs();

export default createSite(docs.toSource()).plugins(llmsPlugin()); // [!code highlight]
```

## Markdown Version [#markdown-version]

A page's Markdown is at its URL plus `.md`, like `/guide/install.md`, or `/index.md` for `/`.

The Markdown is written from what the page renders: the title and description, the heading IDs, resolved expressions, includes and image URLs. A component stays a tag, unless it defines a [Markdown form](#component-markdown):

```md tab="content/guide/install.md"
---
title: Installation
description: Add Acme to your project.
---

<script setup lang="ts">
import { node } from "../../src/versions";
</script>

## Requirements

Acme runs on Node.js {{ node }} or later.

<Callout type="warn">Restart the dev server after you install.</Callout>
```

```ts tab="src/versions.ts"
export const node = "24";
```

```md tab="/guide/install.md"
# Installation

Add Acme to your project.

## Requirements [#requirements]

Acme runs on Node.js 24 or later.

<Callout type="warn">Restart the dev server after you install.</Callout>
```

A [custom page](/custom-pages#markdown-version) has a Markdown version too, when its component sets `markdown` in `defineOptions()`. A plugin's [`transformPageMarkdown`](/content-hooks#markdown-transforms) hook changes every page's Markdown.

### Content Negotiation [#content-negotiation]

An agent that requests a page with `Accept: text/markdown` gets its Markdown at the page's URL, without `.md`:

```bash
curl -H "Accept: text/markdown" https://docs.acme.dev/guide/install
```

A server answers these requests for every page, and so do Vercel and Netlify for a static build. Other static hosts, like GitHub Pages, serve the HTML, and the agent finds the Markdown through the page's link and `llms.txt`.

`llms: { negotiate: false }` turns off content negotiation, for example to save Worker requests on Cloudflare.

### Component Markdown [#component-markdown]

To give a component its own Markdown form, set `markdown` in `defineOptions()`. The function stays out of the browser bundle, and `slots.x()` gives the Markdown of what the component renders in its slot `x`:

```vue title="src/components/Note.vue"
<script setup lang="ts">
import { md, type MarkdownContext } from "vuesho/client";

defineProps<{ title: string }>();

defineOptions({
  markdown: ({ props, slots }: MarkdownContext<{ title: string }>) =>
    md.linePrefix("> ")`**${props.title}**\n\n${slots.default?.()}`,
});
</script>

<template>
  <aside class="note">
    <strong>{{ title }}</strong>
    <slot />
  </aside>
</template>
```

`<Note title="Careful">Read this first.</Note>` becomes:

```md
> **Careful**
>
> Read this first.
```

The [search](/search) index takes the component's text from the same function, which then receives `target: "search"` instead of `"markdown"`.

### MarkdownContext

| Prop        | Type                                                                                                                     | Description                                                                                                                                                                                                          |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `props`     | `Record<string, unknown>`                                                                                                | The props of the component, as the page renders them.                                                                                                                                                                |
| `slots`     | `Record<string, ((props?: Record<string, unknown>) => Promise<string>) \| undefined>`                                    | The Markdown of each slot the tag fills. Without props, a slot gives what the component rendered in it, or its content without props when the component didn't render it. With props, it gives its content for them. |
| `target`    | `MarkdownTarget`                                                                                                         | What the output is for: the page's Markdown, or a search record's text.                                                                                                                                              |
| `page`      | `{ url: string; params: Record<string, string \| string[]>; data?: object; request?: Request; }`                         | The page being written. `data` is a content page's file data, and `request` is the request of a custom page rendered on request.                                                                                     |
| `context`   | `Context<AppShape>`                                                                                                      | The running site's context.                                                                                                                                                                                          |
| `dataRoute` | `<T = unknown>(path: string) => Promise<T \| undefined>`                                                                 | The value of the data route at `path`, as `useDataRoute()` reads it, or `undefined` when none answers.                                                                                                               |
| `component` | `(type: Component, props?: Record<string, unknown>, slots?: Record<string, () => Awaitable<string>>) => Promise<string>` | Writes another component with props and slots, through its Markdown form or else as its tag.                                                                                                                         |

`md` is a template tag that awaits the promises, slots and lists in it. Its methods write Markdown blocks:

```ts
import { md } from "vuesho/client";

md.linePrefix("> ")`${text}`; // Each line with a prefix, like "> " for a quote
md.indent(4)`${text}`; // Each line indented, by 2 spaces by default
md.fence(code, "ts"); // A code block, with a fence longer than any run of backticks in `code`
md.code(text); // Inline code
md.table([
  ["Name", "Type"],
  ["id", "string"],
]); // A table, with the first row as its header
md.escape(text); // The text with the characters Markdown reads as syntax escaped, like `*` and `[`
```

### Rendering Markdown [#rendering-markdown]

A page's Markdown has Vuesho syntax, like `[#id]` after a heading. `pageMarkdownSyntax` from `vuesho/markdown` adds this syntax to another [markdown-it](https://github.com/markdown-it/markdown-it) instance, like one that renders the Markdown on a server:

```npm
npm i markdown-it
```

```ts title="server/render.ts"
import markdownIt from "markdown-it";
import { pageMarkdownSyntax } from "vuesho/markdown";

export const md = markdownIt({ html: true, linkify: true }).use(pageMarkdownSyntax);
```

## llms.txt [#llmstxt]

`/llms.txt` lists the pages in sidebar order, each with a link to its Markdown, and `/llms-full.txt` holds every page's Markdown:

```md title="/llms.txt"
# Docs

- [Hello World](/index.md): Your first document
- Guide
  - [Guide](/guide.md): Learn Acme.
  - [Installation](/guide/install.md): Add Acme to your project.
```

A page with `noindex` is left out of both files, as [SEO](/seo#excluded-pages) shows. Change the files with the preset's `llms` option, or with `llmsPlugin()`'s options:

```ts title="vuesho.config.ts"
createSite(docs.toSource()).plugins(
  recommendedPreset({
    llms: {
      // No `/llms-full.txt`.
      full: false,
      // Adds a section to `/llms.txt`.
      index(text, { path }) {
        if (path !== "/llms.txt") return text;
        return `${text}\n\n## Optional\n\n- [Blog](https://acme.dev/blog)`;
      },
    },
  }),
);
```

### LLMsOptions

| Prop         | Type                                                                                                             | Description                                                                                                                                                                                                                   |
| ------------ | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path?`      | `string \| undefined`                                                                                            | The path of the page index. Default: `"/llms.txt"`                                                                                                                                                                            |
| `full?`      | `string \| false \| undefined`                                                                                   | The path of one file with every page's Markdown, or `false` for none. Default: `"/llms-full.txt"`                                                                                                                             |
| `filter?`    | `((env: PageEnv<AppShape>) => boolean) \| undefined`                                                             | Picks the pages that have a Markdown version at `<page>.md`: a content page, or a page of a route with Markdown. A page it returns `false` for has none and is left out of the files, which never list a page with `noindex`. |
| `section?`   | `((folder: Folder, env: { lang: string; }) => boolean \| { asPath?: string; collapse?: boolean; }) \| undefined` | Tells whether a page tree folder is a section. A section has its own `llms-full.txt` at its URL, like `/docs/llms-full.txt`, which `llms.txt` links to. Root folders are sections by default.                                 |
| `index?`     | `((text: string, env: { lang: string; path: string; }) => Awaitable<string>) \| undefined`                       | Changes the text of each `llms.txt`: the one at `path`, and each collapsed section's. It receives the plugin's text and the file's path without the base path, and returns the text to serve.                                 |
| `negotiate?` | `boolean \| undefined`                                                                                           | Answers a page request that prefers Markdown, with `Accept: text/markdown`, with the page's Markdown: on a server, and for generated pages on a host that routes on request headers. Default: `true`                          |

With multiple languages, each language has these files under its prefix, like `/cn/llms.txt`.

### Sections [#sections]

Each [root folder](/navigation#root-folders) is a section, with an `llms-full.txt` at its URL, like `/guide/llms-full.txt`. `section` sets which folders are sections, and `collapse: true` lists a section in `/llms.txt` as one link to its own `llms.txt`:

```ts title="vuesho.config.ts"
createSite(docs.toSource()).plugins(
  recommendedPreset({
    llms: { section: (folder) => (folder.root ? { collapse: true } : false) }, // [!code highlight]
  }),
);
```

```md tab="Section"
# Docs

- [Hello World](/index.md): Your first document
- [Guide](/guide/llms-full.txt)
  - [Guide](/guide.md): Learn Acme.
  - [Installation](/guide/install.md): Add Acme to your project.
```

```md tab="Collapsed section"
# Docs

- [Hello World](/index.md): Your first document
- [Guide](/guide/llms.txt)
```

## AI Plugins [#ai-plugins]

`@vuesho/ai` has three plugins for AI agents and readers, each in a separate entry:

- `mcpPlugin()` serves an [MCP](https://modelcontextprotocol.io) server, which coding agents like Claude Code and Cursor use to search and read the pages.
- `chatPlugin()` adds an AI chat to the docs layouts. The chat answers questions from the pages.
- `webmcpPlugin()` registers tools for agents in the browser to search, read and open the pages.

```npm
npm i @vuesho/ai
```

The plugins read the pages' [Markdown version](#markdown-version), so also keep `recommendedPreset()` or `llmsPlugin()`. They search with their own index, not your site's [search](/search) index.

## MCP Server [#mcp-server]

`mcpPlugin()` serves the MCP endpoint `/mcp` over streamable HTTP. The endpoint runs on request, so the site needs a [server](/deploying#server-hosting).

### Install the MCP SDK [#install-the-mcp-sdk-step]

```npm
npm i @modelcontextprotocol/server zod
```

### Add the Plugin [#add-the-plugin-step]

```ts title="vuesho.config.ts"
import { mcpPlugin } from "@vuesho/ai/mcp";
import { createSite, recommendedPreset } from "vuesho/config";

export default createSite(docs.toSource()).plugins(
  recommendedPreset(),
  mcpPlugin(), // [!code highlight]
);
```

### Connect an Agent [#connect-an-agent-step]

An agent connects to your deployed site's `/mcp` URL:

```json tab="Claude Code" title=".mcp.json"
{
  "mcpServers": {
    "docs": { "type": "http", "url": "https://docs.acme.dev/mcp" }
  }
}
```

```json tab="Cursor" title=".cursor/mcp.json"
{
  "mcpServers": {
    "docs": { "url": "https://docs.acme.dev/mcp" }
  }
}
```

### Tools [#tools]

The server has three tools. With [Internationalization](/i18n), `search` and `list_pages` take a language, or use the default language.

| Tool         | What it returns                                       |
| ------------ | ----------------------------------------------------- |
| `search`     | The pages that match a query, with their descriptions |
| `list_pages` | Every page, with its URL and description              |
| `get_page`   | A page's Markdown, by its URL or path                 |

`tools` registers more tools on the server, with the [site context](/plugin-api#site-context) as `this`. Its second argument holds the built-in tools, which `update()` changes and `remove()` drops:

```ts title="vuesho.config.ts"
import { mcpPlugin } from "@vuesho/ai/mcp";
import { z } from "zod";
import { searchAcme } from "./server/search";

mcpPlugin({
  path: "/api/mcp",
  server: { name: "Acme Docs", version: "2.0.0" },
  tools(server, { search }) {
    const count = String(this.getPages().length);
    server.registerTool("count_pages", { description: "Count the pages" }, async () => ({
      content: [{ type: "text", text: count }],
    }));

    // Replaces the built-in search.
    search.remove();
    server.registerTool(
      "search",
      { description: "Search the docs", inputSchema: z.object({ query: z.string() }) },
      async ({ query }) => ({
        content: [{ type: "text", text: JSON.stringify(await searchAcme(query)) }],
      }),
    );
  },
});
```

## AI Chat [#ai-chat]

`chatPlugin()` adds an Ask AI button to the docs layouts, and `Ctrl + /` opens the chat too. The chat sends questions to `POST /_ai/chat`, which runs on request, so the site needs a [server](/deploying#server-hosting). `create-vuesho --ai-chat <name>` sets up a new site with a chat on `openrouter`, `llmgateway` or `inkeep`.

### Install the AI SDK [#install-the-ai-sdk-step]

```npm
npm i ai @ai-sdk/vue zod
```

### Add the Plugin [#add-the-plugin-step-1]

`model` takes a model ID on the [AI Gateway](https://vercel.com/docs/ai-gateway), or a model from any [AI SDK](https://ai-sdk.dev) provider:

<Tabs :items='["AI Gateway","Provider"]'>
<Tab value="AI Gateway">
```ts title="vuesho.config.ts"
import { chatPlugin } from "@vuesho/ai/chat";

createSite(docs.toSource()).plugins(
  recommendedPreset(),
  chatPlugin({ model: "openai/gpt-5" }), // [!code highlight]
);
```

```dotenv title=".env.local"
AI_GATEWAY_API_KEY=...
```
</Tab>

<Tab value="Provider">
```npm
npm i @ai-sdk/openai
```

```ts title="vuesho.config.ts"
import { openai } from "@ai-sdk/openai";
import { chatPlugin } from "@vuesho/ai/chat";

createSite(docs.toSource()).plugins(
  recommendedPreset(),
  chatPlugin({ model: openai("gpt-5") }), // [!code highlight]
);
```

```dotenv title=".env.local"
OPENAI_API_KEY=...
```
</Tab>
</Tabs>

`.env.local` isn't deployed, so set the key in your host's environment variables. Without it, the chat answers with an error, and the server logs the cause.

### Rate Limiting [#rate-limiting]

<Callout type="warn" title="Public Endpoint">
`/_ai/chat` is public, and each question calls your provider. Add rate limiting before the site goes live.
</Callout>

A plugin's [`middleware`](/routes#middleware) hook can reject requests before they reach the route:

```ts title="vuesho.config.ts"
import { isRateLimited } from "./server/rate-limit"; // [!code ++]

createSite(docs.toSource()).plugins(
  recommendedPreset(),
  chatPlugin({ model: "openai/gpt-5" }),
  // [!code ++:8]
  {
    name: "site:rate-limit",
    middleware: {
      async handle(request, next, { page }) {
        if (page === "/_ai/chat" && (await isRateLimited(request)))
          return new Response("Too Many Requests", { status: 429 });
        return next();
      },
    },
  },
);
```

### Instructions and Tools [#instructions-and-tools]

The model searches and reads your pages with the `search` and `get_page` tools. `instructions` replaces its system prompt, and `tools` adds [AI SDK tools](https://ai-sdk.dev/docs/foundations/tools):

```ts title="vuesho.config.ts"
import { chatPlugin } from "@vuesho/ai/chat";
import { tool } from "ai";
import { z } from "zod";

chatPlugin({
  model: "openai/gpt-5",
  instructions: "Answer questions about Acme from its docs.",
  tools: {
    status: tool({
      description: "Get the status of the Acme API",
      inputSchema: z.object({}),
      async execute() {
        const response = await fetch("https://status.acme.dev/api");
        return response.json();
      },
    }),
  },
});
```

### Customizing the Chat [#customizing-the-chat]

The chat panel is the `aiChat.panel` layout prop, which the theme's [`layoutProps`](/theme#layout-props) sets. `AIChat` takes `suggestions`, a list of questions for the reader to pick, and the `description` and `renderPart` slots:

```ts title="src/theme.ts"
import { h } from "vue";
import { AIChat } from "@vuesho/ai/theme/chat";
import { defineTheme } from "vuesho/theme";
import defaultTheme from "vuesho/theme/default";

const suggestions = ["How do I deploy?", "What is a plugin?"];
const description = () => "Answers come from the Acme docs.";

export default defineTheme({
  extends: defaultTheme,
  layoutProps: () => ({
    aiChat: { panel: () => h(AIChat, { suggestions }, { description }) },
  }),
});
```

`useAIChat()` opens the chat from any component:

```vue title="src/components/AskAI.vue"
<script setup lang="ts">
import { useAIChat } from "@vuesho/ai/ui";

const { setOpen } = useAIChat();
</script>

<template>
  <button type="button" @click="setOpen(true)">Ask AI</button>
</template>
```

`@vuesho/ai/ui` has the chat's parts, like `AIChatPanel`, `AIChatMessages` and `AIChatInput`, to build your own panel inside `AIChatProvider`. To render its answers with your own markdown-it instance, add `gfm` from `vuesho/markdown/gfm` to it, so task lists and `www.` links render as in the built-in panel.

To edit the parts, copy them into your project with [`vuesho add`](/cli#vuesho-add):

```npm
npx vuesho add ui --from @vuesho/ai
```

### Showing Sources [#showing-sources]

Some providers, like [Inkeep](https://inkeep.com), cite their sources by calling a `provideLinks` tool. Declare the tool in `chatPlugin()`'s `tools` to type the call, and render the links with `AIChatSources` in `renderPart`:

```npm
npm i @ai-sdk/openai-compatible
```

```ts tab="vuesho.config.ts"
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { chatPlugin } from "@vuesho/ai/chat";
import { tool } from "ai";
import { z } from "zod";

const inkeep = createOpenAICompatible({
  name: "inkeep",
  apiKey: process.env.INKEEP_API_KEY,
  baseURL: "https://api.inkeep.com/v1",
});

export const tools = {
  provideLinks: tool({
    inputSchema: z.object({
      links: z.array(z.looseObject({ url: z.string(), title: z.string().nullish() })).nullish(),
    }),
  }),
};

export default createSite(docs.toSource()).plugins(
  recommendedPreset(),
  chatPlugin({ model: inkeep("inkeep-qa-expert"), tools }), // [!code highlight]
);
```

```ts tab="src/theme.ts"
import { h } from "vue";
import type { ChatUIMessage } from "@vuesho/ai/chat";
import { AIChat } from "@vuesho/ai/theme/chat";
import { AIChatSources } from "@vuesho/ai/ui";
import { defineTheme } from "vuesho/theme";
import defaultTheme from "vuesho/theme/default";
import type { tools } from "../vuesho.config";

function renderPart({ part }: { part: ChatUIMessage<typeof tools>["parts"][number] }) {
  if (part.type !== "tool-provideLinks" || part.state === "input-streaming") return;
  return h(AIChatSources, { sources: part.input?.links ?? [] });
}

export default defineTheme({
  extends: defaultTheme,
  layoutProps: () => ({ aiChat: { panel: () => h(AIChat, null, { renderPart }) } }),
});
```

```dotenv tab=".env.local"
INKEEP_API_KEY=...
```

### Translations [#translations]

The chat has language packs for `ja`, `zh-CN` and `zh-TW`, and `ui.translations` changes any of its texts, as [UI Translations](/i18n#ui-translations) shows:

```ts title="vuesho.config.ts"
createSite(docs.toSource(), { i18n }).config({
  ui: {
    translations: { fr: { "Ask AI(AI chat)": "Demander à l'IA" } }, // [!code highlight]
  },
});
```

## Page Selection [#page-selection]

`mcpPlugin()` and `chatPlugin()` read every page with a Markdown version and no `noindex`, including custom pages and views. `filter` leaves pages out, and `getDocument` changes the document that the tools read for a page, with the site context as `this`:

```ts title="vuesho.config.ts"
chatPlugin({
  model: "openai/gpt-5",
  // Leaves out the blog.
  filter: ({ path }) => !path.startsWith("/blog/"),
  // Adds a page's keywords to its Markdown.
  getDocument(document, { page }) {
    const keywords = page?.data.keywords;
    if (!keywords) return document;
    return { ...document, content: `${document.content}\n\nKeywords: ${keywords.join(", ")}` };
  },
});
```

`filter` receives `page` for a content page, or `route` for a custom page or a view, with its `path` and `pageData`. A view has a Markdown version only when its route sets `markdown`. To change a page's Markdown for every reader, use the [`transformPageMarkdown`](/content-hooks#markdown-transforms) hook.

## WebMCP [#webmcp]

<Callout type="warn" title="Experimental">
[WebMCP](https://webmachinelearning.github.io/webmcp/) is an early browser standard. Chrome supports it behind the flag `#enable-webmcp-testing`.
</Callout>

`webmcpPlugin()` registers three tools for an agent in the browser, on a static site or a server:

| Tool          | What it does                                              |
| ------------- | --------------------------------------------------------- |
| `search_docs` | Searches the pages in the page's language, with summaries |
| `read_page`   | Reads a page's Markdown, by its URL                       |
| `open_page`   | Opens a page in the browser                               |

```ts title="vuesho.config.ts"
import { webmcpPlugin } from "@vuesho/ai/webmcp"; // [!code ++]

createSite(docs.toSource()).plugins(
  recommendedPreset(),
  webmcpPlugin(), // [!code ++]
);
```

The plugin takes no options, and its tools read the same pages as the [other AI plugins](#page-selection).

## Options [#options]

### `mcpPlugin()` [#mcpplugin]

### McpPluginOptions

| Prop           | Type                                                                                                                                                                                                                                                                                                         | Description                                                                                                                                                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `path?`        | `string \| undefined`                                                                                                                                                                                                                                                                                        | The endpoint's path. Default: `"/mcp"`                                                                                                                                                                                                   |
| `server?`      | `Partial<{ version: string; name: string; websiteUrl?: string \| undefined; description?: string \| undefined; icons?: { src: string; mimeType?: string \| undefined; sizes?: string[] \| undefined; theme?: "light" \| "dark" \| undefined; }[] \| undefined; title?: string \| undefined; }> \| undefined` | The name and version the server reports to clients. Default: `the name of the site, and "1.0.0"`                                                                                                                                         |
| `tools?`       | `((this: Context<AppShape>, server: McpServer, builtIn: Record<"search" \| "list_pages" \| "get_page", RegisteredTool>) => void \| Promise<void>) \| undefined`                                                                                                                                              | Registers the site's tools on the server for each request, with the site context as `this`. `builtIn` holds the built-in tools: `update()` changes one, like the `search` callback, and `remove()` drops it.                             |
| `filter?`      | `((env: PageEnv<AppShape>) => boolean) \| undefined`                                                                                                                                                                                                                                                         | Leaves out a page when it returns `false`: a content page in `page`, or a page route's page in `route`. The plugin reads the pages whose page data has `markdownUrl` and no `noindex`, as `llms.txt` lists them, which `filter` narrows. |
| `getDocument?` | `((this: Context<AppShape>, document: AgentDocument, page: HeadEnv<AppShape>) => AgentDocument \| Promise<AgentDocument>) \| undefined`                                                                                                                                                                      | The document the plugin reads for a page. It receives the default: the page data's title and description, and the page's Markdown from `getPageMarkdown()`.                                                                              |

### `chatPlugin()` [#chatplugin]

### ChatPluginOptions

| Prop            | Type                                                                                                                                    | Description                                                                                                                                                                                                                              |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`         | `LanguageModel`                                                                                                                         | The model that answers: an AI Gateway ID, like `"openai/gpt-5"`, or a provider's model.                                                                                                                                                  |
| `instructions?` | `string \| undefined`                                                                                                                   | The model's instructions. Default: `an assistant of the site, which searches and reads its pages`                                                                                                                                        |
| `tools?`        | `ToolSet \| undefined`                                                                                                                  | The site's own tools, added to the built-in `search` and `get_page`.                                                                                                                                                                     |
| `stopWhen?`     | `StopCondition<ToolSet> \| StopCondition<ToolSet>[] \| undefined`                                                                       | When the model stops calling tools and answers, like `stopWhen` in `streamText()`. Default: `` `stepCountIs(5)` ``                                                                                                                       |
| `filter?`       | `((env: PageEnv<AppShape>) => boolean) \| undefined`                                                                                    | Leaves out a page when it returns `false`: a content page in `page`, or a page route's page in `route`. The plugin reads the pages whose page data has `markdownUrl` and no `noindex`, as `llms.txt` lists them, which `filter` narrows. |
| `getDocument?`  | `((this: Context<AppShape>, document: AgentDocument, page: HeadEnv<AppShape>) => AgentDocument \| Promise<AgentDocument>) \| undefined` | The document the plugin reads for a page. It receives the default: the page data's title and description, and the page's Markdown from `getPageMarkdown()`.                                                                              |
