Skip to main content
Glama

Analysis of a Spanish text

analyze_text
Read-onlyIdempotent

Measures Spanish texts with exact readability, diversity, morphology, syntax, meter, rhyme, cohesion, style and phonology statistics, returning values, interpretations and warnings.

Instructions

Measure a Spanish text with the statistics of the esTS library.

Use it to get exact numbers about a text instead of judging it by eye. Only the requested groups are computed. Pass a text from a file through path instead of sending it whole: this is faster, and the statistics are computed on the original text.

Statistic groups:

  • basic: sentences, words, syllables, characters, letters, spaces and punctuation marks; unique, long (7 or more letters), complex (3 or more syllables), simple, monosyllabic and polysyllabic words with their share of all words; entropy of word lengths in letters and syllables.

  • readability: readability - the consensus grade and the formulas for Spanish: the Flesch reading ease with the coefficients of the preset (Szigriszt-Pazos or Fernández Huerta), Gutiérrez de Polini, Crawford, Legibilidad µ, SOL, LIX, RIX and the reading time; the grade formulas, the consensus grade and RIX are read as a school stage of Spain and the reader age, the reading ease, Legibilidad µ and LIX as a band of their scales, Gutiérrez de Polini and the reading time have no scale.

  • diversity: lexical diversity - TTR and its corrections, MATTR, MSTTR, MTLD, HD-D, the indices of Simpson, Yule and Honoré, Orlov's Z, entropy, the laws of Zipf and Heaps, burstiness of frequent words.

  • morph: morphology by esMorph in the context of the sentence - parts of speech and 15 grammatical features (the number and share of words with each value) and the shares of the forms that mark the register: the moods among the finite forms (the imperative under-reported), the infinitive, gerund and participle, verb forms with clitics after and before them, ser against estar, adverbs in -mente, diminutives.

  • phon: phonostatistics by the transcription in the pronunciation of Spain - shares of vowels, sonorants, voiced and voiceless obstruents, the ratio of consonants to vowels, heavy consonant clusters, hiatuses inside words and at the junctions of words, junctions of 4 or more consonants, entropy of the CV patterns, hardness, open syllables and syllable length, alliteration and assonance indices.

  • cohesion: cohesion in the manner of Coh-Metrix - repetition of nouns, arguments and content words between sentences (adjacent, all pairs, the next two) and between adjacent paragraphs (a paragraph is a line of the text, with blank_lines a part between blank lines), pronouns and demonstratives, givenness, repetition of tense and mood, connectors per 1000 words - between and inside sentences, by class (causal, adversative, concessive, temporal, additive, conditional, reformulative) and kind.

  • lexical: lexical sophistication by the frequencies of the language - share of the words found in the frequency dictionary of Google Books Ngram, mean frequency (ipm) and its logarithm, range and dispersion over the years, surprisal and perplexity, shares of the words among the 1000-10,000 most frequent lemmas, lexical density, shares of proper nouns and abbreviations. The metrics by the dictionary need it downloaded.

  • verse: verse - lines and stanzas, the syllabic meter and its metrical syllables counted with synalephas and the law of the final stress, lines off the meter and without its rhythmic stresses, the share of rhymed lines (consonante or asonante; with seseo by the option seseo) and the rhyme schemes, aguda, llana and esdrújula endings, the strophes of the stanzas and the form of the poem (soneto, romance, silva). No dictionary is needed: the stresses come from the spelling.

  • syntax: syntax by the dependency tree of esSyntax - dependency lengths, depth and shape of the tree, words before the root, verb valency, clauses, subordinate and infinitive clauses, the indices of L2SCA (T-units, verb phrases, coordinate phrases, complex nominals), coordination chains, noun modifiers, prepositional chains and chains of de (el aumento de la eficiencia del uso de los recursos), participial and gerund clauses, the passive with ser and with se, impersonal se, infinitives, negations, split predicates (llevar a cabo, hacer una revisión), the order of subjects and objects, similarity of adjacent sentences, the ratio of nouns to verbs. The parser overestimates the passive with se and underestimates the impersonal se: read the two together.

  • style: SEO metrics over word forms - classic and academic nausea, water, spam and naturalness by Zipf's law, with no norms for Spanish (compare texts with each other), the most frequent word forms and the most frequent significant words the academic nausea is computed from, lexical markers of the administrative style with the words and phrases found: verbal nouns, compound prepositions, parenthetical expressions, clichés. The syntactic markers of the administrative style - split predicates, chains of de, the passive, participial and gerund clauses, the ratio of nouns to verbs - are in the group syntax: to check a text for the administrative style take style and syntax.

  • unadapted_readability: readability formulas of English, German and Italian with their original coefficients - FORCAST, Linsear Write, Powers-Sumner-Kearl, EFLAW, the four Wiener Sachtextformeln, Dickes-Steiwer, Gulpease, Fucks, Strain, ELF, Wheeler-Smith; they give no Spanish grade and compare Spanish texts with each other and with other tools.

The result has a key for every requested group: a statistic with its value "value", its share "share" or its interpretation by a scale "interpretation", if it has them, and its description "description" - what it computes; the markers of the administrative style of the group style also have the number of occurrences "count" and the words and phrases found "found". The value null means the statistic is undefined on this text. The key "warnings" lists the reasons why the values may be unstable or make no sense for this text: a short text, a text not in Spanish, a dictionary not downloaded (then the warning names the command that downloads it). Read the warnings before drawing conclusions. With per_text the response is "per_text" instead of the groups: "rows" - a row for every text (the link "path", the title "title", the values by the keys «group.key»), "summary" - a summary over the corpus: for numbers the number of texts "n", the mean "mean", the smallest "min" and the largest "max", for strings (the meter) "n" and the frequencies of the values "counts", for dictionaries (parts of speech, rhyme schemes) "n" and the summed frequencies "totals", up to 20 most frequent; a text where the group does not give the statistic has null. The rows are limited to 40 thousand characters, and then a warning says how many are shown, while the summary covers all the texts. The warnings of the texts come once each with the number of texts that have them, and the numbers that differ in them as a range.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "analyze_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoAbsolute path to a UTF-8 text file on the machine where the server runs, or a link ests://datasets/... from find_texts, instead of text: a long text need not be sent in the argument
textNoText in Spanish; path can be given instead
seseoNoRead the rhyme with seseo (group verse): z, and c before e and i, rhyme with s, as in Andalusia, the Canary Islands and America (voz - dos, taza - casa); for a poet who rhymes so
groupsNoStatistic groups; each is a key of the result
per_textNoStatistics «group.key» of every text of a query link to a dataset in path (verse.meter, readability.consensus_grade): the response is a table of the texts with these values and a summary over the corpus instead of the groups; groups are not needed then
blank_linesNoA paragraph is a part of the text between blank lines, not a line (group cohesion): for a text whose lines are wrapped inside its paragraphs
descriptionsNoAdd the descriptions to the statistics; false - a shorter response when the descriptions are already known from a previous call
distributionsNoAdd the distributions of words by number of letters and syllables and of punctuation marks by type (group basic)
readability_presetNoCoefficients of the Flesch reading ease and the scale that reads it and turns it into a grade (group readability): general - Szigriszt-Pazos with the INFLESZ scale, the usual choice for any text; classic - Fernández Huerta with his bands, for comparison with studies and tools that use his formula. Without a particular reason keep generalgeneral

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the annotations, the description discloses key behavioral traits: only requested groups are computed, undefined statistics are null, warnings explain instability, per_text caps rows at 40,000 characters, and some metrics require a downloaded dictionary. It also warns that the syntax parser overestimates passive se and underestimates impersonal se.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well structured with front-loaded purpose and bulleted groups, but it is extremely long and includes output-format details that the output schema already covers. The group catalog is useful but pushes the definition well beyond concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 9-parameter text-analysis tool, the description is complete: it explains group selection, path handling, per_text responses, warnings, null behavior, and the style/syntax combination. Nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, but the description adds substantial meaning to the group enum by explaining what each statistic group computes, and it clarifies path versus text, per_text behavior, blank_lines paragraph semantics, seseo, and readability_preset.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource: measure a Spanish text using the esTS library's statistics. It clearly distinguishes this from eyeballing text by promising exact numbers, but it does not explicitly differentiate itself from sibling tools such as compare_texts or keyness.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear usage context: use it for exact statistics instead of subjective judgment, pass long texts via path, and combine style with syntax to check administrative style. It does not, however, state when to choose this tool over sibling analysis tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.