# Word-by-word analysis

The stored word-by-word analysis of a text: for every word its lemma, dictionary entry, part of speech, Universal Dependencies features, head and relation, and meaning in that sentence, plus an English translation of each sentence.

Canonical: https://interlinea.aeterna-institute.org/docs/mcp/get_analysis

`tools/call get_analysis`

Stored only, never generated: a sentence nobody has opened in Interlinea yet comes back with words: null. Graded passages are fully analysed. Give sentence (0-based) for just one.

## Input

| Field | Type | Description |
|---|---|---|
| `ref` | string | What to read: an Interlinea URL (https://interlinea.aeterna-institute.org/library/latin/virgil/aeneid/1.46, or /read/latin/virgil-aeneid for a graded passage), a CTS URN (urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.46) or a citation ("Virgil, Aeneid 1.46", "Iliad 1.1"). Up to 500 characters. |
| `sentence` | integer | Optional. Only this sentence, counting from 0. |

## Output

`structuredContent` has these fields, and `content` repeats the same JSON as one text item.

| Field | Type | Description |
|---|---|---|
| `kind` | string | One of `section`, `passage`. |
| `lang` | string | Language code: la (Latin) or grc (Ancient Greek). One of `la`, `grc`. |
| `language` | string |  |
| `citation` | string |  |
| `urn` | string or null | CTS URN, e.g. urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11. Null when the edition has none (The Latin Library's own numbering). |
| `url` | string | Absolute URL. |
| `api` | string | Absolute URL. |
| `prev` | object or null |  |
| `prev.citation` | string | "Aeneid 1.12-33" |
| `prev.label` | string | "Book 1, lines 12-33" |
| `prev.url` | string | Absolute URL. |
| `prev.api` | string | The same resource as JSON. |
| `next` | object or null |  |
| `next.citation` | string | "Aeneid 1.12-33" |
| `next.label` | string | "Book 1, lines 12-33" |
| `next.url` | string | Absolute URL. |
| `next.api` | string | The same resource as JSON. |
| `credit` | object |  |
| `credit.text` | string | Credit line for the edition: author, work, editor, source, licence and changes. Quote it when you reuse the text. |
| `credit.license` | string | CC BY-SA 4.0, CC BY 3.0, Used with permission (The Latin Library), or a public-domain note. |
| `credit.licenseUrl` | string or null |  |
| `credit.source` | string | Where the edition comes from. |
| `credit.quality` | string | ocr: an unproofread scan. One of `proofread`, `ocr`. |
| `analysed` | integer | Sentences with a stored analysis. |
| `total` | integer | Sentences in the text. |
| `license` | string | The analyses adapt CC BY-SA text, so they are share-alike. Always `CC BY-SA 4.0`. |
| `note` | string |  |
| `sentences` | array of object |  |
| `sentences[].index` | integer | 0-based sentence index in the text. |
| `sentences[].text` | string |  |
| `sentences[].translation` | string or null | Null when the sentence has no stored analysis yet. |
| `sentences[].words` | array of object or null | Null when the sentence has no stored analysis yet. |
| `sentences[].words[].i` | integer | 1-based index of the word in its sentence. |
| `sentences[].words[].form` | string | The word as printed. |
| `sentences[].words[].lemma` | string | Dictionary headword; Latin with macrons, Greek polytonic. |
| `sentences[].words[].entry` | string or null | Dictionary entry: principal parts, or genitive and gender. |
| `sentences[].words[].upos` | string | Universal Dependencies part of speech. |
| `sentences[].words[].feats` | string | Universal Dependencies features, e.g. "Case=Acc\|Gender=Neut\|Number=Plur"; "_" if none. |
| `sentences[].words[].head` | integer | Index of the word this one depends on; 0 for the root. |
| `sentences[].words[].deprel` | string | Universal Dependencies relation to its head: nsubj, obj, amod, … |
| `sentences[].words[].gloss` | string | Meaning in this sentence, 1 to 4 words. |
| `sentences[].words[].note` | string or null | One sentence on the word's role. |
| `sentences[].words[].enclitic` | object | Optional. Present only when an enclitic rides on the word, e.g. -que "and". |
| `sentences[].words[].enclitic.form` | string |  |
| `sentences[].words[].enclitic.gloss` | string |  |

The same reads as [`GET /api/v1/analysis`](https://interlinea.aeterna-institute.org/docs/api/analysis.md), with the same shape.

## Example call

Arguments:

```json
{
  "ref": "/read/latin/virgil-aeneid",
  "sentence": 0
}
```

curl:

```sh
curl https://interlinea.aeterna-institute.org/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_analysis","arguments":{"ref":"/read/latin/virgil-aeneid","sentence":0}}}'
```

TypeScript:

```js
import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client"

const client = new Client({ name: "my-app", version: "1.0.0" })
await client.connect(new StreamableHTTPClientTransport(new URL("https://interlinea.aeterna-institute.org/mcp")))

const result = await client.callTool({ name: "get_analysis", arguments: { "ref": "/read/latin/virgil-aeneid", "sentence": 0 } })
console.log(result.structuredContent)
```

## Example output

structuredContent:

```json
{
  "kind": "passage",
  "lang": "la",
  "language": "Latin",
  "citation": "Virgil, Aeneid 1.1–11",
  "urn": "urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11",
  "url": "https://interlinea.aeterna-institute.org/read/latin/virgil-aeneid",
  "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/virgil-aeneid",
  "prev": {
    "citation": "Metamorphoses 1.1–9",
    "label": "Bodies Changed",
    "url": "https://interlinea.aeterna-institute.org/read/latin/ovid-metamorphoses",
    "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/ovid-metamorphoses"
  },
  "next": {
    "citation": "Odes 1.11",
    "label": "Seize the Day",
    "url": "https://interlinea.aeterna-institute.org/read/latin/horace-carpe-diem",
    "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/horace-carpe-diem"
  },
  "credit": {
    "text": "Virgil, Aeneid 1.1–11. CC BY-SA 4.0. Perseus Digital Library (Tufts University), PerseusDL/canonical-latinLit; edition: J. B. Greenough, Gin…",
    "license": "CC BY-SA 4.0",
    "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
    "source": "https://scaife.perseus.org/reader/urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11/",
    "quality": "proofread"
  },
  "analysed": 1,
  "total": 4,
  "license": "CC BY-SA 4.0",
  "note": "Stored analyses only, made by a language model when a reader first opened the text and checked by rules (one root, no loops, valid labels).…",
  "sentences": [
    {
      "index": 0,
      "text": "Arma virumque cano, Troiae qui primus ab oris\nItaliam, fato profugus, Laviniaque venit\nlitora, multum ille et terris iactatus et alto\nvi sup…",
      "translation": "I sing of arms and a man, who first, an exile by fate, came from the shores of Troy to Italy and the Lavinian shores, that man having been t…",
      "words": [
        {
          "i": 1,
          "form": "Arma",
          "lemma": "arma",
          "entry": "arma, armōrum n. pl.",
          "upos": "NOUN",
          "feats": "Case=Acc|Gender=Neut|Number=Plur",
          "head": 3,
          "deprel": "obj",
          "gloss": "arms",
          "note": "Accusative plural, direct object of cano."
        },
        {
          "i": 2,
          "form": "virumque",
          "lemma": "vir",
          "entry": "vir, virī m.",
          "upos": "NOUN",
          "feats": "Case=Acc|Gender=Masc|Number=Sing",
          "head": 1,
          "deprel": "conj",
          "gloss": "man",
          "note": "Accusative singular, direct object of cano, joined to Arma by the enclitic -que.",
          "enclitic": {
            "form": "-que",
            "gloss": "and"
          }
        },
        {
          "i": 3,
          "form": "cano",
          "lemma": "canō",
          "entry": "canō, canere, cecinī, cantum",
          "upos": "VERB",
          "feats": "Aspect=Imp|Mood=Ind|Number=Sing|Person=1|Tense=Pres|VerbForm=Fin|Voice=Act",
          "head": 0,
          "deprel": "root",
          "gloss": "I sing",
          "note": "Main verb of the sentence, present active indicative, first person singular."
        },
        // 25 more
      ]
    }
  ]
}
```

---

Previous: [Read a text](https://interlinea.aeterna-institute.org/docs/mcp/get_text.md)
Next: [Look up a word](https://interlinea.aeterna-institute.org/docs/mcp/lookup_word.md)
