Skip to main content
Glama
baburajr

elasticsearch-mcp

by baburajr

find_slow_queries

Read-only

Find slow queries by cross-referencing average query latency, running search tasks, thread-pool queues, and search slowlog thresholds. Control top results with top_n.

Instructions

Find what is slow. Combines: indices ranked by average query latency (_stats), currently running search tasks with elapsed time (_tasks), search thread-pool queue/rejection counts per node, and the configured search slowlog thresholds per index (so you know whether slowlog is even on). Use top_n to control how many indices come back.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNo*
top_nNo
min_avg_msNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The annotations already declare read-only, non-destructive behavior, and the description adds useful behavioral detail on top: it reads four distinct backend signals, checks whether slowlog is enabled, and bounds the result with top_n. This goes beyond what the input schema or annotations alone reveal.

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?

The description is compact and front-loaded with the main goal, then gives a precise inventory of data sources and a plugging guidance for controlling result size. Each sentence adds substantive information; only minor redundancy exists in the 'average latency' phrase and the min_avg_ms parameter implication.

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

Completeness3/5

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

The output schema exists and covers return structure, and the annotations cover safety behavior. However, the description leaves index and min_avg_ms underspecified. Since all parameters are optional, this is a moderate completion gap rather than a severe one.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must provide parameter meaning. Only top_n is directly explained. index and min_avg_ms are not explicitly connected to the schema inputs, even though 'average query latency' hints at min_avg_ms.

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

Purpose5/5

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

The description opens with a clear goal, 'Find what is slow', then specifies exactly what inputs it combines: indices ranked by average query latency, running search tasks, thread-pool queue/rejection counts, and slowlog thresholds. This makes it clearly distinct from sibling tools like run_query, explain_query, and get_task, which focus on individual queries rather than aggregated slow-query diagnosis.

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?

The intended use case is implied: use this when investigating slow query performance. However, the description gives no explicit when-not-to-use guidance and does not contrast this tool with alternatives such as explain_query, get_task, or cluster_health.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/baburajr/elasticsearch_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server