{
  "tools": [
    {
      "name": "motif_lookup",
      "description": "Look up motifs in the Thompson Motif-Index. Pass tmi_id for an exact address (e.g. 'A1010'), or query to search labels in plain words (e.g. 'flood', 'descent to lower world'). Returns motif rows with their filed-attestation counts.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tmi_id": {
            "type": "string",
            "description": "Exact Thompson id, e.g. 'A1010'"
          },
          "query": {
            "type": "string",
            "description": "Plain-words label search, e.g. 'flood'"
          }
        }
      },
      "run": "/api/v1/tools/motif_lookup"
    },
    {
      "name": "attestation_search",
      "description": "Find where a motif lives in the served texts, three lanes in one call: curated attestations (quotable as filed), wired_citations (Thompson's own citation resolved to an exact served chapter — open it with episode_lookup and quote the text), and computed_leads (keyword matches, ~half real — open, confirm the motif is actually in the episode, silently drop the misses). Filter by tmi_id, tradition slug, or work slug — at least one required. This is how you turn an index address into actual story text.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tmi_id": {
            "type": "string",
            "description": "Thompson id, e.g. 'A1010'"
          },
          "tradition": {
            "type": "string",
            "description": "Tradition slug, e.g. 'mesopotamian'"
          },
          "work": {
            "type": "string",
            "description": "Work slug, e.g. 'gilgamesh'"
          }
        }
      },
      "run": "/api/v1/tools/attestation_search"
    },
    {
      "name": "tradition_profile",
      "description": "Profile a tradition's shelf: its works, episode counts, and how many motif attestations are filed against it. Pass slug (e.g. 'mesopotamian'); omit to list all traditions.",
      "input_schema": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Tradition slug; omit to list all"
          }
        }
      },
      "run": "/api/v1/tools/tradition_profile"
    },
    {
      "name": "episode_lookup",
      "description": "Read an episode of a work. Pass work (slug, e.g. 'gilgamesh') and optionally canonical_ref (e.g. 'Tablet XI'). Returns the episode text when its license permits public display; otherwise the reference + provenance pointer only.",
      "input_schema": {
        "type": "object",
        "properties": {
          "work": {
            "type": "string",
            "description": "Work slug, e.g. 'gilgamesh'"
          },
          "canonical_ref": {
            "type": "string",
            "description": "e.g. 'Tablet XI'; omit to list the work's episodes"
          }
        },
        "required": [
          "work"
        ]
      },
      "run": "/api/v1/tools/episode_lookup"
    },
    {
      "name": "motif_neighbors",
      "description": "The knowledge graph around one motif: the traditions Thompson filed it under (his index apparatus, ~49k labeled citations), its place in the index hierarchy (parent + finer motifs beneath), his cross-references ('travels with'), and the ATU tale types that carry it (weighted by recorded variants). Use for 'what keeps company with X', 'which traditions carry X', and for finding the one thread worth opening.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tmi_id": {
            "type": "string",
            "description": "Thompson id, e.g. 'A1010'"
          }
        },
        "required": [
          "tmi_id"
        ]
      },
      "run": "/api/v1/tools/motif_neighbors"
    },
    {
      "name": "compare_traditions",
      "description": "THE STITCH, as one call: every witness of a motif AND its child motifs (the whole story-shape family), grouped by tradition — curated attestations, wired Thompson citations resolved to served chapters, and the top computed leads (read-and-discard applies). Each witness carries its work, reference, and composition era. Use for 'which traditions carry X', 'compare X across cultures', and as the skeleton of any cross-tradition telling; open the best 2–4 witnesses with episode_lookup to quote.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tmi_id": {
            "type": "string",
            "description": "Thompson id, e.g. 'A1010' — find it with motif_lookup first"
          }
        },
        "required": [
          "tmi_id"
        ]
      },
      "run": "/api/v1/tools/compare_traditions"
    },
    {
      "name": "myth_timeline",
      "description": "THE LONG AXIS: the same witnesses as compare_traditions but ordered by composition era, oldest first — watch a story-shape move through time from clay tablet to novel. Composition date is when the WITNESS was fixed in writing, not the story's age; the tool's rows say so. Use for 'did X change over time', 'what is the oldest version of X', era-spanning questions.",
      "input_schema": {
        "type": "object",
        "properties": {
          "tmi_id": {
            "type": "string",
            "description": "Thompson id, e.g. 'A1010'"
          }
        },
        "required": [
          "tmi_id"
        ]
      },
      "run": "/api/v1/tools/myth_timeline"
    },
    {
      "name": "commentary_search",
      "description": "THE SYMBOLIZE LANE: full-text search restricted to the commentary shelves — early psychology (Jung 1916, Freud), comparative scholarship (Tylor, Harrison, Frazer), and the alchemical corpus. Use when the question asks what something MEANS or SYMBOLIZES: quote these voices as dated commentary ('Tylor argued in 1871...'), never blended into a tale's own voice, and keep the boundary audible. The post-1930 moderns are not here and never quoted — name-only, with library_lookup for cite-and-locate.",
      "input_schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search terms, e.g. 'serpent symbol rebirth'"
          }
        },
        "required": [
          "query"
        ]
      },
      "run": "/api/v1/tools/commentary_search"
    },
    {
      "name": "episode_search",
      "description": "Full-text search across the complete text of EVERY served episode — all works, all traditions, all shelves at once (primary myth, literary, commentary, alchemical; each hit labeled by work_class). Use when the question's words are not Thompson's index language: an image, an object, a phrase, a name. Space-separated terms must all match; falls back to any-term when nothing carries them together. Matches are in each translator's English and spellings of names vary by edition (Väinämöinen/Wainamoinen) — retry a missed name under another spelling before concluding absence. Returns ranked snippets; follow a hit with episode_lookup and quote from the full episode, never from the snippet alone.",
      "input_schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Search terms, e.g. 'wolf swallows sun'"
          },
          "work": {
            "type": "string",
            "description": "Optional work slug to search within, e.g. 'kalevala'"
          },
          "tradition": {
            "type": "string",
            "description": "Optional tradition slug to search within, e.g. 'norse'"
          }
        },
        "required": [
          "query"
        ]
      },
      "run": "/api/v1/tools/episode_search"
    },
    {
      "name": "tale_type_lookup",
      "description": "Look up ATU tale types — the plot-skeleton index (Aarne–Thompson–Uther). Pass atu_id for an exact number (e.g. '425', '425A') or query to search type names ('lost husband'). Returns number, name, category, and how many motifs the record links into the type. Full Uther descriptions are not served (license) — numbers and names are the served facts; the motifs and their texts carry the substance.",
      "input_schema": {
        "type": "object",
        "properties": {
          "atu_id": {
            "type": "string",
            "description": "Exact ATU number, e.g. '425A'"
          },
          "query": {
            "type": "string",
            "description": "Type-name search, e.g. 'lost husband'"
          }
        }
      },
      "run": "/api/v1/tools/tale_type_lookup"
    },
    {
      "name": "library_quote",
      "description": "Quote from the OWNED research library: mythoi's own shelf first (new acquisitions like Thompson's revised Motif-Index), then seba's across the seam (Jung CW, Campbell, Hillman, von Franz, Edinger). Full-text search returning excerpts with author/title/year; pass expand=true for the fuller passage around a hit. THE FOUNDER'S FAIR-USE RULE: quote up to 400 words at a time, ALWAYS cited inline (author, work, year). Frame as the commentator's argument, never the record's claim or the tale's voice. Chat answers only; served pages remain public-domain.",
      "input_schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "What you want the depth tradition's voice on, e.g. 'hero journey threshold' or 'ouroboros'"
          },
          "author": {
            "type": "string",
            "description": "Optional author filter, e.g. 'Jung' or 'Campbell'"
          },
          "expand": {
            "type": "boolean",
            "description": "true = include the fuller passage (~400 words) around each hit"
          }
        },
        "required": [
          "query"
        ]
      },
      "run": "/api/v1/tools/library_quote"
    },
    {
      "name": "logoi_ask",
      "description": "Ask the librarian at logoi.health — the sibling house of WORDS (Greek/Hebrew lemmas, etymologies, word counts across its corpus). Use SPARINGLY, only when a question turns on a word's meaning or history beyond this record ('what does thumos actually mean', 'etymology of daimon'); each crossing costs the family. Returns the librarian's answer with their receipts — attribute it as logoi's desk, never as this record.",
      "input_schema": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "The word question, plainly put (≤300 chars)"
          }
        },
        "required": [
          "question"
        ]
      },
      "run": "/api/v1/tools/logoi_ask"
    },
    {
      "name": "library_lookup",
      "description": "Search the family research library's holdings (the seba house, across the estate seam) by author or title. Returns bibliographic holdings only — author, title, year — for cite-and-locate: you may tell the user the library HOLDS a work and point into it, but its text is never served or quoted here. Use when a question wants the depth tradition's voice (Jung, Hillman, von Franz, Edinger, Campbell...) beyond what the public-domain reference shelf carries.",
      "input_schema": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "description": "Author or title fragment, e.g. 'Edinger' or 'Eternal Return'"
          }
        },
        "required": [
          "query"
        ]
      },
      "run": "/api/v1/tools/library_lookup"
    },
    {
      "name": "receipt_get",
      "description": "Fetch a receipt by slug when provenance is questioned. Returns the receipt's scope, sources consulted (with licenses and checksums), and evidence notes including what the claim does NOT prove.",
      "input_schema": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "Receipt slug, e.g. 'attest-a1010-gilgamesh-xi'"
          }
        },
        "required": [
          "slug"
        ]
      },
      "run": "/api/v1/tools/receipt_get"
    }
  ],
  "envelope": {
    "ok": "boolean",
    "tool": "string",
    "data": "tool-specific",
    "source_ids": "string[] — provenance rows behind the result",
    "receipt_url": "string|null — the filed receipt, when one backs the result",
    "note": "string? — honest-empty and truncation notes"
  }
}