discovery

A guide to making documentation and its APIs discoverable to software agents. It covers catalogs, DNS-based discovery, an agent-skills index, robots.txt, and HTTP Link headers.

In plain words
What is it for?
Use it to publish API catalogs, identify documentation APIs, advertise agent entry points, and help automated tools locate the site's callable surfaces.
Why use it?
An endpoint is difficult for agents to use if they cannot find it or tell which API it belongs to. These discovery methods advertise the available documentation and service descriptions.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/duvinc/duvlify/discovery
Clone the repo
git clone --depth 1 https://github.com/DuvInc/duvlify
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,154 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.02154
Opus 5 $0.00015 $0.01077
Sonnet 5 $0.00006 $0.00431
Haiku 4.5 $0.00003 $0.00215

Measured 2d ago against content hash 8d52e419d0b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

discovery scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

handbook/agents/discovery.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Discoverability

An endpoint that no agent ever finds is dead code. The build advertises each endpoint in the places agents actually look: the ## Optional section of llms.txt, a comment block in robots.txt, and Link headers on every page.

/.well-known/api-catalog

The Worker serves two more well-known URIs, both defined relative to the origin: /.well-known/mcp.json (with the server-card spelling beside it) and /.well-known/api-catalog.

The catalog follows RFC 9727, a specification that answers a question the documentation itself cannot: which API. A site that documents a product actually has two APIs: the product's own API, and this documentation's own read-only API under /api/docs. Until an agent reads the docs, it has no way to tell the two apart. The catalog states the difference in one fetch:

{
  "linkset": [
    { "anchor": "https://api.example.com/v1",
      "service-desc": [{ "href": "https://docs.example.com/openapi.json", "type": "application/openapi+json" }],
      "service-doc":  [{ "href": "https://docs.example.com/", "type": "text/html" }] },
    { "anchor": "https://docs.example.com/api/docs",
      "service-desc": [{ "href": "https://docs.example.com/api/docs/openapi.json", "type": "application/openapi+json" }],
      "service-doc":  [{ "href": "https://docs.example.com/", "type": "text/html" }],
      "status":       [{ "href": "https://docs.example.com/api/docs", "type": "application/json" }] }
  ]
}

Three details matter, and test/agents.test.mjs asserts each one rather than leaving it to review:

  • The media type is application/linkset+json (RFC 9264), not application/json. A client negotiating for a linkset will not accept the generic type.
  • Every relation's value is an array of link target objects, even when there is only one link. A bare object is well-formed JSON, but no generic client reads it correctly.
  • The first entry is anchored on the API's own base URL, taken from the specification's servers[0].url, not on the page that describes it. This lets an agent holding a request URL match it against the catalog.

Read the full file on GitHub · 177 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 177 lines · 31 tokens per session scan A 8d52e419d0b1

Subscribe to this mod's changes

discovery is an agent published in the GitHub repository DuvInc/duvlify (23 stars, last pushed 4d ago), licensed MIT. It adds 31 tokens to every session and 2,154 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.