{
  "name": "engine-v2",
  "description": "Docs search for agents: lexical-first evidence packs over structure-aware chunks of developer documentation.",
  "version": "0.1.0",
  "tools": [
    {
      "name": "search_docs",
      "method": "GET",
      "path": "/api/search",
      "params": {
        "q": "required. Search query — plain terms, error strings, or API symbols.",
        "docset": "optional. Restrict to one docset id from list_docsets.",
        "limit": "optional. 1-20, default 8."
      },
      "returns": "Evidence pack: { query, answerable, mode, results: [{title, url, anchor, docset, heading_path, snippet, relevance, source_type, license, last_crawled, content_hash, fetch}], budget_used, guidance }"
    },
    {
      "name": "fetch_doc",
      "method": "GET",
      "path": "/api/fetch",
      "params": {
        "url": "required. Page URL previously returned by search_docs.",
        "max_chars": "optional. Truncate markdown to this many characters."
      },
      "returns": "{ url, title, markdown, content_hash, fetched_at } or raw markdown with Accept: text/markdown"
    },
    {
      "name": "list_docsets",
      "method": "GET",
      "path": "/api/docsets",
      "params": {},
      "returns": "{ docsets: [...] }"
    },
    {
      "name": "add_docset",
      "method": "POST",
      "path": "/api/docsets",
      "params": {
        "url": "required. Docs root, llms.txt URL, or docs section URL.",
        "name": "optional. Display name.",
        "max_pages": "optional. Page cap for ingestion, default 40, max 200."
      },
      "returns": "202 { docset_id, workflow_id, status_url } — ingestion is async; poll status_url."
    },
    {
      "name": "refresh_docset",
      "method": "POST",
      "path": "/api/docsets/{id}/refresh",
      "params": {},
      "returns": "202 { docset_id, workflow_id, status_url }"
    },
    {
      "name": "feedback",
      "method": "POST",
      "path": "/api/feedback",
      "params": {
        "query": "required. The query the evidence was used for.",
        "url": "optional. Source page URL.",
        "chunk_id": "optional. Chunk id from search results.",
        "outcome": "required. solved | not_helpful | stale | wrong_version",
        "note": "optional. Free text."
      },
      "returns": "201 { ok: true }"
    }
  ]
}