AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Mintlify `llms.txt` and Contextual Summaries for AI Coding Agents

Silja Naumann · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

When modern developers use AI coding agents like Cursor, Claude Code, and GitHub Copilot to integrate your API, they rarely browse your graphical web documentation. Instead, these agents inspect files, query web search endpoints, and crawl URLs directly into their limited context windows. If your documentation platform only serves heavy HTML filled with React hydration bundles, sticky sidebars, marketing popups, and nested navigation shells, the agent’s context window is quickly consumed by useless DOM markup. The result is predictable: truncated endpoint definitions, dropped schema attributes, and hallucinated API parameters.

Mintlify provides native support for the /llms.txt standard, /llms-full.txt full-text dumps, and automatic Markdown content negotiation. However, treating Mintlify’s AI features as a "set and forget" default is a major mistake. Mintlify builds its llms.txt file and agent index directly from your project's configuration (docs.json) and page-level frontmatter. If you feed Mintlify an unpruned navigation tree or vague documentation descriptions, you will generate an unnavigable 100,000-character index, trigger recursive index splitting, and confuse coding agents.

At 365Finds, our research stance is firm: API teams must treat their docs.json navigation and frontmatter metadata as a first-class machine interface. You must deliberately curate your navigational boundaries, enforce high-density contextual summaries, and structure your OpenAPI specs to guarantee zero-shot agent comprehension with minimal token overhead.


1. The Wire-Format Problem: Why Agents Fail on Traditional Docs

AI coding agents interact with technical documentation in three distinct ways:

  1. Direct Markdown Fetching: An agent requests a specific URL using Accept: text/markdown or appends .md to read an endpoint directly.
  2. Global Index Parsing (llms.txt): An agent downloads the root index to discover which endpoints and tutorials exist before picking relevant files.
  3. Full Context Injection (llms-full.txt): A developer feeds the entire documentation corpus into an agent prompt or IDE session (common in Claude Code and Cursor projects).
Interaction ModeTraditional HTML DocumentationMintlify AI-Native Pipeline
Index DiscoveryIncomplete sitemaps; noisy navigation treesStandardized /llms.txt with structured H2 modules
Endpoint Ingestion50 KB – 300 KB HTML payloads; script noisePure Markdown via Accept: text/markdown or .md
Context Window Consumption80%+ wasted on DOM layout, CSS, and navigationNear 100% signal ratio focused on schema and examples
Agent Discovery SpeedRequires multi-hop search or RAG chunk scrapingImmediate zero-shot endpoint mapping via single index

Mintlify automatically injects Link: </llms.txt>; rel="llms-txt" headers and serves clean Markdown when an AI crawler requests a page. But what actually goes into that clean Markdown is entirely determined by your architecture.


2. Navigational Gating in docs.json

The most critical architectural decision is using your docs.json file as an intentional AI gating boundary.

By default, Mintlify operates with seo.indexing: "navigable". This means Mintlify’s search crawler, AI Assistant, and /llms.txt generator only index pages explicitly registered in the navigation object of docs.json. Unlisted .mdx files remain live and accessible via direct URLs for human users who need them, but they are excluded from the AI index.

Anti-Pattern: The Kitchen-Sink Navigation

Many API teams configure their docs.json with marketing landing pages, company announcements, legal terms, changelog archives, and internal tutorials. When Mintlify compiles /llms.txt, every single one of these irrelevant entries appears as a primary link. An agent looking for payment webhook signatures ends up wading through company culture posts and deprecated v1 tutorials.

Recommended Pattern: Clean Separation of Guides and API Topology

We recommend structuring docs.json using tabs and scoped groups. Place human onboarding guides in one tab and machine-critical API reference endpoints in another:

{
  "$schema": "https://mintlify.com/docs.json",
  "name": "Acme API Platform",
  "theme": "mint",
  "description": "High-throughput payment gateway and ledger API for modern fintech applications.",
  "seo": {
    "indexing": "navigable"
  },
  "navigation": {
    "tabs": [
      {
        "tab": "Guides",
        "groups": [
          {
            "group": "Getting Started",
            "pages": [
              "guides/quickstart",
              "guides/authentication",
              "guides/errors-and-retries"
            ]
          },
          {
            "group": "Event Handling",
            "pages": [
              "guides/webhooks-setup",
              "guides/webhook-signatures"
            ]
          }
        ]
      },
      {
        "tab": "API Reference",
        "groups": [
          {
            "group": "Customers",
            "pages": [
              "api-reference/customers/create",
              "api-reference/customers/retrieve",
              "api-reference/customers/update"
            ]
          },
          {
            "group": "Payments",
            "pages": [
              "api-reference/charges/create",
              "api-reference/charges/capture",
              "api-reference/refunds/create"
            ]
          }
        ]
      }
    ]
  }
}

By keeping marketing announcements, legal disclaimers, and internal release notes out of docs.json, you ensure that every token consumed by the agent’s index crawl corresponds to actionable technical content.


3. Designing Contract-Dense Frontmatter Summaries

When Mintlify generates /llms.txt, each entry is formatted as a Markdown bullet item:

- [Page Title](Page URL): Page Description

If your page frontmatter omits the description field, Mintlify either leaves the summary empty or extracts arbitrary text from your introductory paragraph. An agent reading llms.txt has to guess what the endpoint does or spend additional network requests fetching every page individually.

The 365Finds Standard: Operational Contract Summaries

Never use marketing prose (e.g., "Our payments endpoint lets you effortlessly charge cards"). Instead, treat the description string as an executable API contract summary containing four mandatory elements:

  1. HTTP Verb and Route: [POST /v1/charges]
  2. Auth Scope: Bearer (charges:write)
  3. Primary Payload: Core required body attributes
  4. Return Model: Primary status code and object returned

Frontmatter Example for MDX Endpoints

---
title: "Create a Charge"
description: "[POST /v1/charges] Auth: Bearer (charges:write). Required: amount (int, cents), currency (ISO 4217), source (token). Idempotency key supported via Idempotency-Key header. Returns Charge object (201)."
openapi: "POST /v1/charges"
---

When Mintlify reads this frontmatter, your generated /llms.txt displays:

- [Create a Charge](/api-reference/charges/create): [POST /v1/charges] Auth: Bearer (charges:write). Required: amount (int, cents), currency (ISO 4217), source (token). Idempotency key supported via Idempotency-Key header. Returns Charge object (201).

Why This Dramatically Improves AI Agent Performance

When Cursor or Claude Code ingests this /llms.txt file, it can frequently generate correct API integration calls without ever loading the full /api-reference/charges/create.md page! It already knows the endpoint URL, required authorization header, idempotency convention, and required request payload fields. This cuts token consumption by over 90% and completely prevents parameter hallucination.


4. Managing Token Budgets and the 100,000-Character Threshold

A critical technical constraint in Mintlify that most engineering teams miss is the 100,000-character limit on /llms.txt.

When your documentation structure exceeds 100,000 characters:

  1. Mintlify preserves the root /llms.txt as a high-level table of contents.
  2. It automatically splits your endpoints into sub-indexes located under /_llms/ (for example, https://docs.yourcompany.com/_llms/api-reference.txt).
  3. To keep split files under the threshold, Mintlify may truncate lengthy page descriptions.

While recursive splitting ensures large documentation sets remain discoverable, it forces AI coding agents to make multiple recursive network round-trips. In automated agent environments like Claude Code or headless CI agents, every extra round-trip introduces latency, increases failure rates, and burns inference budget.

Strategic Token Governance

To keep your core documentation index within a single, highly dense /llms.txt:


5. Integrating with Cursor, Claude Code, and Agent Skills

Once your docs.json and frontmatter are optimized, you should enable automated agent integration for your developer community.

1. Embed the Agent Skill Prompt

Mintlify supports native Agent Skills through the Model Context Protocol (MCP) and the standard skill.md specification. In your documentation’s getting started guide, embed the native <Prompt> component so developers using Cursor can install your API skills with a single click:

<Prompt description="Install the official API skill into Cursor or Claude Code" actions={["copy", "cursor"]}>
npx skills add https://docs.yourcompany.com
</Prompt>

When an agent installs this skill, it automatically absorbs your site schema, component definitions, and /llms.txt index.

2. Providing Direct Agent Instructions (.cursorrules or CLAUDE.md)

In your SDK starter templates and example repositories, provide an agent configuration file that points the model directly to your Mintlify endpoints:

# Agent Context Guidelines for Acme API

When generating code that integrates with Acme API:
1. Primary index: Check https://docs.yourcompany.com/llms.txt for endpoint signatures.
2. Endpoint details: Fetch clean Markdown by appending `.md` (e.g., https://docs.yourcompany.com/api-reference/charges/create.md).
3. Do not scrape HTML pages. Always rely on the raw Markdown endpoints.

Summary Checklist for API Teams

StepActionDirect Benefit to AI Agents
1. Navigation FilteringSet seo.indexing: "navigable"; exclude changelogs, blogs, and marketing from docs.json.Eliminates non-technical noise; prevents agent distraction.
2. Modular StructureSeparate Guides and API Reference using navigation tabs and grouped modules.Gives agents clear hierarchical context for intent mapping.
3. Contract SummariesWrite frontmatter descriptions containing [METHOD /path], scopes, required keys, and returns.Enables 0-shot endpoint matching directly from /llms.txt.
4. Threshold ControlKeep index under 100,000 characters to prevent multi-hop /_llms/ splitting.Reduces agent latency and token burn; avoids description truncation.
5. Skill DistributionEmbed <Prompt actions={["cursor"]}> for npx skills add and expose .md URLs.Streamlines developer agent onboarding in Cursor and Claude Code.

By treating your Mintlify documentation as an executable API data plane rather than a visual brochure, you ensure that every AI agent generating code for your platform does so accurately, reliably, and with minimal token cost.

References