Skip to main content
Glama
cr7258

Elasticsearch MCP Server

analyze_text

Tokenize text with Elasticsearch/OpenSearch analyzers to debug search matches and understand token transformations.

Instructions

Analyze text to see how it would be tokenized.

Use this tool to understand how Elasticsearch/OpenSearch tokenizes and transforms text using analyzers. This is essential for debugging search queries and understanding why certain documents match or don't match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe text to analyze
indexNoIndex name to use its configured analyzer. If not specified, uses cluster-level analysis with built-in analyzers only.
filterNoList of token filters to apply (e.g., ['lowercase', 'stop']). Used with 'tokenizer' for custom analysis chain.
clusterNoOptional cluster name. Uses the default cluster if omitted.
explainNoIf True, returns detailed information about each token including all token attributes and filter transformations. Useful for debugging complex analyzer chains.
analyzerNoName of the analyzer to use (e.g., 'standard', 'korean', 'korean_search'). If index is specified, you can use custom analyzers defined in that index.
tokenizerNoTokenizer to use for custom analysis chain. Cannot be used together with 'analyzer'.
attributesNoList of token attributes to return when explain=True (e.g., ['keyword', 'type']). If not specified, all attributes are returned.
char_filterNoList of character filters to apply before tokenization. Used with 'tokenizer' for custom analysis chain.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv2.1.4
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / analyzer / description
      Added value: +"Name of the analyzer to use (e.g., 'standard', 'korean',\n     'korean_search'). If index is specified, you can use\n     custom analyzers defined in that index."
    • addedInput schema / properties / attributes / description
      Added value: +"List of token attributes to return when explain=True\n       (e.g., ['keyword', 'type']). If not specified, all\n       attributes are returned."
    • addedInput schema / properties / char_filter / description
      Added value: +"List of character filters to apply before tokenization.\n        Used with 'tokenizer' for custom analysis chain."
    • addedInput schema / properties / cluster / description
      Added value: +"Optional cluster name. Uses the default cluster if omitted."
    • addedInput schema / properties / explain / description
      Added value: +"If True, returns detailed information about each token\n    including all token attributes and filter transformations.\n    Useful for debugging complex analyzer chains."
    • addedInput schema / properties / filter / description
      Added value: +"List of token filters to apply (e.g., ['lowercase', 'stop']).\n   Used with 'tokenizer' for custom analysis chain."
    • addedInput schema / properties / index / description
      Added value: +"Index name to use its configured analyzer. If not specified,\n   uses cluster-level analysis with built-in analyzers only."
    • addedInput schema / properties / text / description
      Added value: +"The text to analyze"
    • addedInput schema / properties / tokenizer / description
      Added value: +"Tokenizer to use for custom analysis chain. Cannot be\n      used together with 'analyzer'."
  2. Addedv2.1.2

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. 'Analyze' implies a non-destructive read operation, and the debugging framing reinforces that, but the description discloses nothing about permissions, whether it touches cluster state, rate limits, or side effects. Adequate but not rich.

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 first sentence is front-loaded and effective, but the next two sentences restate the same idea ('understand how ... tokenizes', 'understanding why ... match') with noticeable redundancy and without adding new information.

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

Completeness4/5

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

For a read-only analysis tool with a 100%-covered schema and an output schema that handles return values, the description covers purpose and primary use case well. The main gap is the absence of alternative-routing guidance, which matters given the large sibling set.

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

Parameters3/5

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

Schema description coverage is 100%, so every one of the 9 parameters is already documented in the schema. The description adds no parameter-level meaning beyond what the schema provides (the analyzer/tokenizer/index relationships and defaults all live in the schema), so the baseline 3 applies.

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 states a specific verb and resource ('analyze text to see how it would be tokenized') and clarifies the domain (Elasticsearch/OpenSearch analyzers). It is clear enough to distinguish from mutating siblings, but it never names a sibling or explicitly scopes itself against the read/index tools around it.

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

Usage Guidelines3/5

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

It gives a use case – debugging search queries and understanding why documents match or don't match – which implies when to reach for it. However, there are no explicit when-not conditions, no named alternatives (e.g., search_documents for actually running queries), and no prerequisites.

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