Skip to main content
Glama

Concordance

kwic
Read-onlyIdempotent

Find every occurrence of a word or phrase in Spanish text with surrounding context to inspect exact usage and quote lines; optionally match all inflected forms by lemma.

Instructions

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/...? are searched one by one: the context does not run into the next text.

The result has "n_matches" - the number of occurrences, and "matches" - the lines in the order of the text: the left context "left", the occurrence "keyword" as written in the text and the right context "right"; a line of a text of a dataset also has the link "path" and the title "title" of that text. The lines are limited by the parameter limit and by about 40 thousand characters of the response in all. The key "warnings" lists the warnings: a text not in Spanish, not all occurrences shown.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "keyword": "<keyword>"
    },
    "name": "kwic"
  }
}

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
limitNoLargest number of lines in the response
windowNoNumber of words of context on the left and on the right
keywordYesWord or phrase
by_lemmaNoFind every form of a word by its lemma: gato finds gatos, cantar finds cantaba

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Annotations cover only readOnly/idempotent/closed-world; the description adds substantive semantics the annotations cannot: case-insensitive matching, accents as part of the word, lemma-based matching with the vino ambiguity example, phrases not spanning sentence boundaries, per-text isolation of context, the ~40k character response cap combined with limit, and the conditions that populate 'warnings'. These materially change how an agent should issue and interpret calls.

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

Conciseness4/5

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

Front-loaded with the core purpose, then parameters, then result shape — a sensible order with no filler. Some sentences are convoluted or garbled (e.g. 'a word of the query by any lemma of its analyses', 'a query link ests://datasets/...?<filters> are searched one by one'), which costs a point.

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 6-parameter read tool with an output schema and annotations, everything an agent needs is present: matching rules, boundary rules, truncation, warning conditions, and how to supply text via path vs. text. Return-value structure is partly redundant with the output schema but no required behavior is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description goes further: it explains by_lemma beyond the schema's one-line gloss (esMorph lemmas, the vino example), ties limit to the global ~40k character cap, and clarifies that path links come from find_texts. Window and text receive no additional meaning, keeping it below a 5.

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?

States a specific verb and resource ('Find every occurrence of a word or a phrase in a text with its context') and names the KWIC concordance output format. It does not explicitly distinguish itself from siblings like collocations or analyze_text, but the resource (occurrence-in-context lines) is distinctive enough that an agent can recognize it.

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?

'Use it to see how a word is used in the text and to quote it exactly' gives a clear positive use case. There are no exclusions or named alternatives, and no statement of when a different tool (e.g. collocations) would be preferable, so it falls short of a 5.

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