Skip to main content
Glama
baburajr

elasticsearch-mcp

by baburajr

generate_dsl

Read-only

Build Elasticsearch Query DSL from a structured JSON spec, validate it against the real index, and get a field catalog to fix field names before running.

Instructions

Build Elasticsearch Query DSL from a structured spec, then validate it against the real index. Supply spec as JSON with any of: text, text_fields, filters [{field, op, value}], must_not, should, time_field/time_from/time_to, sort, size, aggs [{name, type, field, size, interval}], highlight_fields, source_includes. Ops: eq, neq, in, not_in, gt, gte, lt, lte, exists, missing, prefix, wildcard, match, match_phrase. Returns the generated DSL plus validation result and a field catalog so you can correct field names before running it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYes
indexYes
validateNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already indicate readOnly, openWorld, and non-destructive, and the description adds meaningful behavioral nuance: the tool validates generated queries against the real index and returns a field catalog to guide corrections. It does not cover edge behavior/errors, but the safety profile is already declared.

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

Conciseness5/5

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

The description is compact but information-dense: purpose first, then a structured list of accepted spec shapes, operators, and return value. Every sentence contributes, and no content is wasted.

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 tool with a complex spec object and 0% schema descriptions coverage, the description gives enough details for an agent to supply a valid input and understand what will be returned. Since output schema exists, return-format explanation is unnecessary.

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?

Despite 0% schema parameter description coverage, the description compensates for the critical spec param by enumerating supported top-level keys, filter operators, agg fields, and sort/size options. Index and validate are not elaborated, but they are self-explan from names and schema.

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?

States a clear, specific action: generate Elasticsearch Query DSL from a structured spec and validate it against the real index. The resource is identifiable and the explanation distinguishes generation/validation from execution-oriented/neighbor tools like run_query or sql_translate.

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?

The description conveys when to use it, especially via 'correct field names before running it', signaling a validation-before-execution workflow. It does not explicitly name sibling alternatives or give exclusions, so a perfect routing guidance is absent.

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