WebMCP Tool Reference

Documesh is an application powered by WebMCP. These are the exact tools this website registers via document.modelContext.registerTool() — the contract any compatible agent discovers and operates when you open this site in ChatGPT's in-app browser or Chrome with WebMCP enabled.

What is WebMCP?

WebMCP is an emerging open standard (W3C Web Machine Learning community group, developed with Microsoft and Google) that lets a website declare structured tools for AI agents. Instead of an agent scraping HTML and guessing, the page hands over a machine-readable tool list: names, descriptions, JSON Schemas. The agent reads the contract and calls tools directly — while the visual UI stays on screen for the human. Think of it as the difference between reading a building's floor plan and wandering the halls hoping to find the right room.

Connect an agent

ChatGPT (in-app browser)

Open documesh.dev in ChatGPT's in-app browser and ask naturally: "search the docs for edge function environment variables." WebMCP is supported out of the box — the agent finds and calls the tools.

Google Chrome 149+

Enable chrome://flags/#enable-webmcp-testing, restart, then open the site and converse with your WebMCP-compatible agent of choice.

Design principles

  • 1.Risk-typed tools. Every tool declares its class — answer (read-only), act (mutates app state), transact (guarded). All Documesh tools are read-only today.
  • 2.Provenance mandatory. Responses without license, source_url and last_updated fail at the schema level — attribution is structural, not optional.
  • 3.Honest abstention. explain_error labels low-confidence results as "closest matches" and never presents a guess as the answer.
  • 4.One tool per intent. No near-duplicate tool spam — models lose accuracy on bloated tool lists, so the mesh keeps a minimal canonical surface.

Tools

answer read-only · safe

search_docs_across

Search federated developer documentation across all mesh vendors. Returns ranked excerpts with version, license, and canonical source URL for every result.

Request
{
  "query": "edge functions environment variables",
  "vendors": ["netlify", "vercel"],   // optional filter
  "limit": 5                          // optional, default 5
}
Response
{
  "snapshot_date": "2026-08-30",
  "results": [{
    "vendor": "netlify", "version": "latest",
    "title": "Environment variables at Netlify",
    "section": "Build > Environment variables > Overview",
    "excerpt_link": "https://docs.netlify.com/build/env/overview/",
    "license": "Netlify Docs (agent-permitted via llms.txt)",
    "last_updated": "2026-08-30", "relevance": 274.66
  }]
}
Vendors: cloudflare · netlify · vercel · kubernetes · bun · elysia · turso · upstash · sentry · stripe · hono · nuxt · solid · opentelemetry · argocd
answer read-only · honest abstention built in

explain_error

Given a log excerpt or error message, find the closest matching documentation sections across mesh vendors. Extracts error signatures (exception names, k8s reasons, errno codes, exit codes) and returns version-cited sections with an explicit disclaimer.

Request
{
  "log_excerpt": "Back-off restarting failed container. Error: CrashLoopBackOff",
  "vendor": "kubernetes"   // optional filter
}
Response
{
  "extracted_signatures": ["CrashLoopBackOff", "Error: CrashLoopBackOff…"],
  "matches": [{
    "vendor": "kubernetes",
    "title": "How Pods handle problems with containers",
    "source_url": "https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/",
    "license": "CC-BY-4.0", "score": 252.4
  }],
  "disclaimer": "These are the closest documentation sections, not a diagnosis…"
}
Eval: 5/5 curated real-world errors matched the correct section in top-3 (100%).
answer read-only · no parameters

list_vendors

List the documentation vendors in the mesh with their license and attribution requirements. Lets an agent verify provenance before citing.

Response (abridged)
{ "vendors": [{
    "id": "cloudflare", "name": "Cloudflare Developers",
    "license": "CC-BY-4.0",
    "license_url": "https://github.com/cloudflare/cloudflare-docs/…/LICENSE",
    "docs_origin": "developers.cloudflare.com (official llms.txt)",
    "attribution_required": true
  }, /* … 14 more */ ],
  "snapshot_date": "2026-08-30" }

Vendor registry

All 15 sources, their legal basis, and ingestion interface. Full detail on the coverage page.

VendorLicenseInterface

Registration snippet

This is the actual pattern used on this site (simplified):

// app.html — registers Documesh capabilities with any visiting agent
const ctx = document.modelContext;

ctx.registerTool({
  name: "search_docs_across",
  description: "Search federated developer documentation…",
  inputSchema: {
    type: "object",
    properties: {
      query:   { type: "string", description: "Search query" },
      vendors: { type: "array",  description: "Optional vendor filter" },
      limit:   { type: "number", description: "Max results" }
    },
    required: ["query"]
  },
  execute: async (input) => {
    const data = await fetch(`/search?q=${input.query}`).then(r => r.json());
    return data;  // license + source + version on every result
  }
});

Response contract

Every tool response satisfies these invariants — enforced by the indexer and API, verifiable by any agent:

license present on every result
source_url → canonical vendor page
last_updated dated snapshot
✅ excerpts only — never full-text mirroring
✅ deterministic scoring (same query → same order)
✅ explicit disclaimers on probabilistic matches