{"openapi":"3.1.0","info":{"title":"Livonian dictionary access","version":"2.1.1"},"paths":{"/api/health":{"get":{"tags":["livonian"],"summary":"Liveness probe","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"type":"object","title":"Response Health Api Health Get"}}}}}}},"/api":{"get":{"tags":["livonian"],"summary":"API usage","operationId":"index_api_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Index Api Get"}}}}}}},"/api/search":{"get":{"tags":["livonian"],"summary":"Search the dictionary","operationId":"search_api_search_get","parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":120,"description":"A single content word, not a phrase — one per call; search synonyms separately (e.g. 'water', not 'to water'; 'see' then 'look', not 'see look'). With search_language=liv, an inflected form is resolved to its dictionary lemma when the form is known (see search_method in the response).","title":"Query"},"description":"A single content word, not a phrase — one per call; search synonyms separately (e.g. 'water', not 'to water'; 'see' then 'look', not 'see look'). With search_language=liv, an inflected form is resolved to its dictionary lemma when the form is known (see search_method in the response)."},{"name":"search_language","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SearchLanguage","description":"Query language: eng | liv | lat | est.","default":"eng"},"description":"Query language: eng | liv | lat | est."},{"name":"include_forms","in":"query","required":false,"schema":{"type":"boolean","description":"Attach each match's full inflection table inline (one call, no follow-up). Bounded by the per-search cap. Defaults to false here — the MCP tool defaults to true.","default":false,"title":"Include Forms"},"description":"Attach each match's full inflection table inline (one call, no follow-up). Bounded by the per-search cap. Defaults to false here — the MCP tool defaults to true."},{"name":"max_forms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":12,"minimum":0},{"type":"null"}],"description":"Override the number of inline tables this request (0–12); omit for the server default cap.","title":"Max Forms"},"description":"Override the number of inline tables this request (0–12); omit for the server default cap."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/romanize":{"get":{"tags":["livonian"],"summary":"Romanize Livonian to clean ASCII","operationId":"romanize_api_romanize_get","parameters":[{"name":"text","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":4000,"description":"Livonian text to romanize.","title":"Text"},"description":"Livonian text to romanize."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Romanization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/deromanize":{"get":{"tags":["livonian"],"summary":"Find the Livonian word(s) matching a romanized spelling","operationId":"deromanize_api_deromanize_get","parameters":[{"name":"text","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":4000,"description":"Romanized (clean-ASCII) Livonian text. Returns attested dictionary spellings whose romanization matches (source=dictionary); on a miss, a single best-effort reconstruction (source=reconstruction, approximate=true). Coverage grows as words are cached, so the same query may return a reconstruction now and a dictionary hit later.","title":"Text"},"description":"Romanized (clean-ASCII) Livonian text. Returns attested dictionary spellings whose romanization matches (source=dictionary); on a miss, a single best-effort reconstruction (source=reconstruction, approximate=true). Coverage grows as words are cached, so the same query may return a reconstruction now and a dictionary hit later."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deromanization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/inflections":{"get":{"tags":["livonian"],"summary":"Inflection/conjugation table","operationId":"inflections_api_inflections_get","parameters":[{"name":"entry_id","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d+$","description":"Word id from a handle.","title":"Entry Id"},"description":"Word id from a handle."},{"name":"word_class","in":"query","required":true,"schema":{"type":"string","description":"Word-class code, e.g. s, vi, vt.","enum":["adj","s","vi","vt"],"title":"Word Class"},"description":"Word-class code, e.g. s, vi, vt."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/NominalParadigm"},{"$ref":"#/components/schemas/VerbalParadigm"},{"$ref":"#/components/schemas/ParadigmNotFound"}],"discriminator":{"propertyName":"category","mapping":{"nominal":"#/components/schemas/NominalParadigm","verbal":"#/components/schemas/VerbalParadigm","not_found":"#/components/schemas/ParadigmNotFound"}},"title":"Response Inflections Api Inflections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Candidate":{"properties":{"word":{"type":"string","title":"Word","description":"A real orthographic word (source=dictionary) or the best-effort reconstruction (source=reconstruction)."},"source":{"type":"string","enum":["dictionary","reconstruction"],"title":"Source","description":"dictionary = an ATTESTED spelling recalled from the dictionary index (exact, no guessing); reconstruction = a best-effort algorithmic guess, returned only when no attested word matched (never emitted by Interslavic transliterate, which returns empty on a miss instead)."},"kind":{"anyOf":[{"type":"string","enum":["lemma","form"]},{"type":"null"}],"title":"Kind","description":"For a lossy-family dictionary candidate, whether the word is a headword (lemma) or an inflected form. None for a reconstruction, and always None for Interslavic transliterate (which does not distinguish lemma from form)."}},"type":"object","required":["word","source"],"title":"Candidate","description":"One candidate spelling from a reverse-lookup surface (deromanize /\ndetransliterate, or Interslavic transliterate)."},"Deromanization":{"properties":{"original":{"type":"string","title":"Original","description":"The romanized text as given."},"candidates":{"items":{"$ref":"#/components/schemas/Candidate"},"type":"array","title":"Candidates","description":"Real spellings whose romanization matches the query (source=dictionary), in a deterministic — NOT confidence-ranked — order; equally-valid readings of the ambiguous key. Bounded by cached vocabulary, so NOT guaranteed exhaustive: a real word not yet fetched won't appear, and the same query may return a reconstruction before a word is cached and a dictionary hit after."},"approximate":{"type":"boolean","title":"Approximate","description":"True when the only candidate is a best-effort reconstruction (no attested word matched); False when candidates are attested dictionary spellings."}},"type":"object","required":["original","candidates","approximate"],"title":"Deromanization","description":"The API-facing payload: the query plus its candidate real spellings."},"Entry":{"properties":{"headword":{"type":"string","title":"Headword"},"pronunciation":{"type":"string","title":"Pronunciation","description":"Phonetic form in braces, e.g. {äm}.","default":""},"part_of_speech":{"type":"string","title":"Part Of Speech","description":"e.g. 'noun', 'verb', 'adjective'.","default":""},"type_code":{"type":"string","title":"Type Code","description":"Paradigm type code, e.g. '99', '53a'.","default":""},"entry_id":{"type":"string","title":"Entry Id","description":"Numeric word id for the forms endpoint.","default":""},"word_class":{"type":"string","title":"Word Class","description":"Word-class code, e.g. 's', 'vt', 'adj'.","default":""},"senses":{"items":{"$ref":"#/components/schemas/Sense"},"type":"array","title":"Senses"}},"type":"object","required":["headword"],"title":"Entry","description":"One dictionary entry (one upstream result card): the headword with its\npronunciation, part of speech, paradigm anchors, and senses.\n\n``entry_id`` + ``word_class`` are the same anchors carried by an\n:class:`InflectionHandle` — feed them to ``livonian_get_inflections`` for the full paradigm.\nEvery field except ``headword``/``gloss`` defaults, so a card missing a\npronunciation, type code, or senses still validates."},"Example":{"properties":{"livonian":{"type":"string","title":"Livonian"},"english":{"type":"string","title":"English","default":""}},"type":"object","required":["livonian"],"title":"Example","description":"One usage example for a sense: the Livonian sentence and its English translation.\n``english`` is empty when the upstream entry gives the Livonian without a gloss."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InflectionHandle":{"properties":{"entry_id":{"type":"string","title":"Entry Id","description":"Numeric word id used by the forms endpoint."},"word_class":{"type":"string","title":"Word Class","description":"Word-class code, e.g. 's', 'vi', 'vt', 'adj'."},"context":{"type":"string","title":"Context","description":"Nearby headword / entry text.","default":""},"pos_hint":{"type":"string","title":"Pos Hint","description":"Part-of-speech hint near the link.","default":""},"forms":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/NominalParadigm"},{"$ref":"#/components/schemas/VerbalParadigm"},{"$ref":"#/components/schemas/ParadigmNotFound"}],"discriminator":{"propertyName":"category","mapping":{"nominal":"#/components/schemas/NominalParadigm","not_found":"#/components/schemas/ParadigmNotFound","verbal":"#/components/schemas/VerbalParadigm"}}},{"type":"null"}],"title":"Forms","description":"The full inflection paradigm, populated when a search is asked to include forms. None when not requested or beyond the cap; category 'none' when the word has no paradigm."}},"type":"object","required":["entry_id","word_class"],"title":"InflectionHandle","description":"A reliable, structured anchor for fetching a full paradigm. Feed\n``entry_id`` + ``word_class`` to ``livonian_get_inflections`` — or ask ``search`` to\ninclude the table inline (``forms``)."},"NominalParadigm":{"properties":{"category":{"type":"string","const":"nominal","title":"Category","default":"nominal"},"entry_id":{"type":"string","title":"Entry Id"},"word_class":{"type":"string","title":"Word Class"},"found":{"type":"boolean","const":true,"title":"Found","default":true},"cases":{"additionalProperties":{"$ref":"#/components/schemas/NumberForms"},"type":"object","title":"Cases","description":"Case name (English, lower-case) → its singular/plural forms, in paradigm order, e.g. 'nominative', 'genitive', 'partitive'."},"source":{"type":"string","title":"Source","default":"Ernštreits, Valts (ed. in chief), Viitso, Tiit-Rein, Kurpniece, Milda & Vāvere, Signis. 2024. Livonian morphology database. Riga: University of Latvia Livonian Institute. https://livonian.tech/ (CC BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/) Adapted: reformatted and condensed from the original."}},"type":"object","required":["entry_id","word_class","cases"],"title":"NominalParadigm","description":"Declension of a noun/adjective/numeral/pronoun: case → {singular, plural}.\n\n``category`` discriminates this from the verbal and not-found shapes — switch on it\nbefore reading the body."},"NumberForms":{"properties":{"singular":{"type":"string","title":"Singular"},"plural":{"type":"string","title":"Plural"}},"type":"object","required":["singular","plural"],"title":"NumberForms","description":"A nominal cell: the two number forms of one case. Livonian forms are verbatim."},"ParadigmNotFound":{"properties":{"category":{"type":"string","const":"not_found","title":"Category","default":"not_found"},"entry_id":{"type":"string","title":"Entry Id"},"word_class":{"type":"string","title":"Word Class"},"found":{"type":"boolean","const":false,"title":"Found","default":false},"source":{"type":"string","title":"Source","default":"Ernštreits, Valts (ed. in chief), Viitso, Tiit-Rein, Kurpniece, Milda & Vāvere, Signis. 2024. Livonian morphology database. Riga: University of Latvia Livonian Institute. https://livonian.tech/ (CC BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/) Adapted: reformatted and condensed from the original."}},"type":"object","required":["entry_id","word_class"],"title":"ParadigmNotFound","description":"No paradigm for this entry_id/word_class (the morphology DB has none, or the\nhandle was wrong). ``found`` is False and there is no table body."},"Polarity":{"properties":{"affirmative":{"type":"string","title":"Affirmative"},"negative":{"type":"string","title":"Negative"}},"type":"object","required":["affirmative","negative"],"title":"Polarity","description":"A verbal cell: the two polarities of one person in one mood/tense. ``negative``\nis the ready-to-use form — the negation auxiliary (äb/äd/iz/algõ…) is already folded\nin (e.g. ``äb toup``), not orphaned in a separate column. Livonian forms are verbatim."},"Romanization":{"properties":{"original":{"type":"string","title":"Original","description":"The Livonian text as given."},"text":{"type":"string","title":"Text","description":"The romanized ASCII output."}},"type":"object","required":["original","text"],"title":"Romanization","description":"Livonian text reduced to clean, pronounceable ASCII (no diacritics or\ncapitals; the broken tone becomes a hyphen) for an English-trained downstream."},"SearchLanguage":{"type":"string","enum":["liv","lat","est","eng"],"title":"SearchLanguage","description":"Which language the query word is matched against. Headwords come back in\nLivonian and glosses in English either way; this only selects the language the\nquery term is in. Codes are the site's own."},"SearchResult":{"properties":{"query":{"type":"string","title":"Query"},"language":{"$ref":"#/components/schemas/SearchLanguage"},"found":{"type":"boolean","title":"Found","description":"False when nothing matched."},"handles":{"items":{"$ref":"#/components/schemas/InflectionHandle"},"type":"array","title":"Handles"},"entries":{"items":{"$ref":"#/components/schemas/Entry"},"type":"array","title":"Entries","description":"Structured dictionary entries: headword, pronunciation, part of speech, paradigm anchors, and senses with example sentences."},"forms_truncated":{"type":"integer","title":"Forms Truncated","description":"How many handles did NOT get an inline table because the per-search cap was reached. Refine the query or call livonian_get_inflections.","default":0},"search_method":{"type":"string","enum":["direct","lemma_index"],"title":"Search Method","description":"How the match was found: 'direct' = the query itself matched; 'lemma_index' = the query was an inflected Livonian form, resolved to its dictionary lemma via the cached paradigm index and re-searched.","default":"direct"},"resolved_from":{"type":"string","title":"Resolved From","description":"The original inflected query when search_method='lemma_index'; empty on a direct match.","default":""},"resolved_lemma":{"type":"string","title":"Resolved Lemma","description":"The dictionary lemma actually searched when search_method='lemma_index'; empty on a direct match.","default":""},"source":{"type":"string","title":"Source","default":"Ernštreits, Valts (ed. in chief), Viitso, Tiit-Rein, Vāvere, Signis, Damberg, Pētõr, Kurpniece, Milda, Balodis, Uldis, Tuisk, Tuuli, Kūla, Gita, Tomingas, Marili, Soosaar Sven-Erik, Sedláčková, Anna & Jurgenovskis, Toms. 2024. Livonian lexicographic database. Riga: University of Latvia Livonian Institute. https://livonian.tech/ (CC BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/) Adapted: reformatted and condensed from the original."}},"type":"object","required":["query","language","found"],"title":"SearchResult","description":"The result of a dictionary search."},"Sense":{"properties":{"label":{"type":"string","title":"Label","default":""},"gloss":{"type":"string","title":"Gloss"},"examples":{"items":{"$ref":"#/components/schemas/Example"},"type":"array","title":"Examples"}},"type":"object","required":["gloss"],"title":"Sense","description":"One sense of a headword: its gloss and any usage examples. ``label`` is the\nupstream sense marker (``a)``, ``b)``) and is empty for a single, unlabelled sense."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerbalParadigm":{"properties":{"category":{"type":"string","const":"verbal","title":"Category","default":"verbal"},"entry_id":{"type":"string","title":"Entry Id"},"word_class":{"type":"string","title":"Word Class"},"found":{"type":"boolean","const":true,"title":"Found","default":true},"finite":{"additionalProperties":{"additionalProperties":{"$ref":"#/components/schemas/Polarity"},"type":"object"},"type":"object","title":"Finite","description":"Mood/tense (English, lower-case: 'present', 'past', 'conditional', …) → pronoun (Livonian, verbatim: ma/sa/ta/mēg/tēg/ne) → {affirmative, negative}. The negative already includes its auxiliary."},"nonfinite":{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"type":"object","title":"Nonfinite","description":"Non-finite section (English, lower-case: 'principal parts', 'participles') → form label (English) → the Livonian form."},"source":{"type":"string","title":"Source","default":"Ernštreits, Valts (ed. in chief), Viitso, Tiit-Rein, Kurpniece, Milda & Vāvere, Signis. 2024. Livonian morphology database. Riga: University of Latvia Livonian Institute. https://livonian.tech/ (CC BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/) Adapted: reformatted and condensed from the original."}},"type":"object","required":["entry_id","word_class","finite","nonfinite"],"title":"VerbalParadigm","description":"Conjugation of a verb, grouped the way the grammar is: finite moods/tenses by\nperson and polarity, plus the non-finite forms.\n\n``category`` discriminates this from the nominal and not-found shapes."}}}}