esTS-mcp

v0.1.0
io.github.SergeyShk/ests-mcp Checked 14 hours ago Published 1 day ago

MCP server for esTS: statistics of Spanish texts as tools for LLM agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

analyze_text Analysis of a Spanish text

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 s…

ParameterTypeDescription
blank_linesbooleanA 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
descriptionsbooleanAdd the descriptions to the statistics; false - a shorter response when the descriptions are already known from a previous call
distributionsbooleanAdd the distributions of words by number of letters and syllables and of punctuation marks by type (group basic)
groupsarrayStatistic groups; each is a key of the result
pathAbsolute 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
per_textarrayStatistics «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 co…
readability_presetstringCoefficients 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; clas…
seseobooleanRead 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
textstringText in Spanish; path can be given instead

kwic Concordance

Find every occurrence of a word or a phrase in a text with its context (KWIC concordance). Use it to see how a word is used in the text and to quote it exactly. Words are compared ignoring case; accents are part of the word (solo and sólo are two words); with by_lemma - by the lemmas of esMorph in the context of the sentence (a word of the query by any lemma of its analyses: vino finds both the wine and the forms of venir). A phrase does not run across the end of a sentence. The texts of a query link ests://datasets/...?<filters> are searched one by one: the context does not run into the nex…

ParameterTypeDescription
keyword *stringWord or phrase
by_lemmabooleanFind every form of a word by its lemma: gato finds gatos, cantar finds cantaba
limitintegerLargest number of lines in the response
pathAbsolute 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
textstringText in Spanish; path can be given instead
windowintegerNumber of words of context on the left and on the right

collocations Collocations

Find the collocations of a text - pairs of words that occur together more often than by chance. Use it for set phrases, terminology and the company of a word (the parameter node; side - only the words before or after it). A pair is ordered: the right word stands at most window words after the left one. The lemmas are those of esMorph in the context of the sentence, as kwic finds them with by_lemma. The texts of a query link ests://datasets/...?<filters> go one after another, and at the junction of two texts the pairs are made of the words of both: the company within one text is more exact by…

ParameterTypeDescription
lemmatizebooleanCompare lemmas: estado de ánimo and estados de ánimo give one pair
measurestringAssociation measure: logdice - the strength of a pair, independent of the size of the text; mi overrates rare pairs; mi3 and t_score favour frequent ones
min_freqintegerSmallest freq_pair - the number of pairs of positions in the window
nodeWord whose company is needed; not set - all the pairs
pathAbsolute 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
sideSide of the company of node: left - the words before it, right - after it; not set - on both sides
textstringText in Spanish; path can be given instead
top_nintegerNumber of collocations in the response
windowintegerLargest distance between the words of a pair; 1 - bigrams

dispersion Dispersion of words

Measure how evenly words are spread over a text (Gries's dispersion). Use it to tell a word that runs through the whole text from a word gathered in one place: frequency does not tell them apart. The text is divided into the given number of parts of about equal size, and the texts of a query link ests://datasets/...?<filters> are the parts themselves, so the measure shows whether a word runs through the texts of the corpus. The result has "n_words" - the number of words of the text, "n_parts" - the number of parts, and "words" - the words in the order of the query or by decreasing frequency,…

ParameterTypeDescription
lemmatizebooleanCompare lemmas: the forms of a word count as one word
partsintegerNumber of parts of the text of about equal size; for a query link ests://datasets/...?<filters> its texts are the parts
pathAbsolute 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
textstringText in Spanish; path can be given instead
top_nintegerNumber of the most frequent words if words is not set
wordsWords whose dispersion is needed; not set - the most frequent words

keyness Keywords

Find the keywords of a text - words significantly more (or less) frequent in it than in a reference. Use it to see how the vocabulary of a text differs from the language at large (the default reference is the frequency dictionary, downloaded by the command ests-mcp download) or from another text (reference or reference_path). Against the dictionary the words of the text are read in the context of their sentences and compared by the lemmas of the dictionary (a verb takes the first of its verb analyses: fue - ser, also in fue a casa), a proper noun by the lemma of its form taken alone, under wh…

ParameterTypeDescription
lemmatizebooleanCompare lemmas; against the frequency dictionary lemmas are always compared
measurestringMeasure of the sorting: log_likelihood - the significance of the difference, log_ratio - how many times more frequent the word is
min_freqintegerSmallest frequency of a word where it is more frequent
nintegerLength of the n-grams: 1 - words, 2-3 - phrases of consecutive words within a sentence, only against a reference text; with lemmatize these are phrases of lemmas (el casa), and kwic finds them with by…
pathAbsolute 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
positivebooleanWords more frequent in the text; false - more frequent in the reference
referenceReference text; not set (nor reference_path) - the frequency dictionary of Google Books Ngram (Spanish books of 1980-2019)
reference_pathAbsolute path to a file with the reference text or a link ests://datasets/... from find_texts instead of reference; a query link - all its texts as one reference
textstringText in Spanish; path can be given instead
top_nintegerNumber of keywords in the response

compare_texts Comparison of corpora

Compare two corpora of texts by the features of style and find where they differ most. Use it for authorship attribution and for comparing genres, translations, texts by a person and by a model. The texts are cut in order into windows of exactly window words (whole_texts - the whole texts), 210 features of esTS are computed for every window, and the distributions of a feature in the corpora A and B are compared. The rest of a text shorter than a window and a text shorter than a window are left out: the response warns about such texts and about losing more than 10% of the words of a corpus. Th…

ParameterTypeDescription
aarrayTexts of the first corpus (A)
a_pathsarrayAbsolute paths to files with the texts of corpus A or links ests://datasets/... from find_texts, with a or instead of it; a query link gives all its texts as separate texts of the corpus
barrayTexts of the second corpus (B)
b_pathsarrayAbsolute paths to files with the texts of corpus B or links ests://datasets/... from find_texts, with b or instead of it; a query link gives all its texts as separate texts of the corpus
top_nintegerNumber of the features with the largest difference
whole_textsbooleanCompare the whole texts, without windows; needs two texts at least in each corpus
windowSize of a window in words; not set - at most 1000 and such that the shortest text splits into two windows at least, but at least 100

visualize Charts of a text

Draw a chart of a text with the visualizers of esTS: a PNG image and a short summary in numbers. Use it when a distribution is clearer shown than retold: the user sees the image, and the summary gives the numbers for conclusions. The charts chart: - zipf: Zipf's law - the frequencies of the words by rank on a logarithmic scale with the Zipf-Mandelbrot fit; the summary - the slope and the most frequent words. - heaps: Heaps' law - the growth of the number of unique words with the length of the text; the summary - the exponent of the law. - spectrum: frequency spectrum - how many unique words o…

ParameterTypeDescription
chart *stringChart (see the description of the tool)
heightintegerHeight of the image in pixels
pathAbsolute 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
textstringText in Spanish; path can be given instead
widthintegerWidth of the image in pixels
wordsarrayWords for chart=dispersion, up to 10

find_texts Texts of the datasets

Find texts in the datasets of esTS and get links to them for the other tools. Use it when a reference text or corpus is needed: the sonnets of a poet, the prose of a classic, the drama of an epoch. The texts do not come in the response: pass the link "path" (ests://datasets/<dataset>/<number>) to path, reference_path, a_paths or b_paths of any tool instead of a path to a file, or the link "query" to take all the texts found: analyze_text and collocations take them as one text (analyze_text with per_text - a table of the statistics of every text), kwic, dispersion and keyness tell the texts ap…

ParameterTypeDescription
dataset *stringDataset of esTS
authorAuthor, a part of the name regardless of case and accents
countryCountry of the author (of birth in spanish_sonnets), a part of its Spanish name regardless of case and accents: España, México, Argentina
genderGender of the author in spanish_sonnets
genreGenre of spanish_literature
limitintegerNumber of texts in the response
max_lenLargest length of a text in characters
min_lenSmallest length of a text in characters
offsetintegerHow many texts found to skip: the next page
periodPeriod of spanish_sonnets
year_fromEarliest year of the first publication in spanish_literature
year_toLatest year of the first publication in spanish_literature