Skip to main content
Glama
baburajr

elasticsearch-mcp

by baburajr

index_document

Create or overwrite a single document in Elasticsearch by passing JSON. Optionally specify doc_id to overwrite a document, otherwise auto-ID is assigned; set refresh=true for immediate search.

Instructions

Index (create or overwrite) a single document into an index. Pass doc as a JSON object. Optional doc_id: given, it overwrites that id; omitted, ES assigns one. Set refresh=true to make it searchable immediately (slower). Requires writes enabled and confirm=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes
doc_idNo
confirmNo
refreshNo
documentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond annotations, the description discloses overwrite semantics, automatic ID assignment when doc_id is omitted, the searchability/performance trade-off of refresh=true, and the mandatory confirm=true requirement. This gives the agent realistic expectations about mutation and preconditions.

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?

Each sentence carries a separate useful fact: operation/semantics, doc body, doc_id behavior, refresh trade-off, plus confirm/writes requirement. There is no fluff; it is front-loaded and economical.

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?

Given the output schema, no return-value description is needed. The description covers the write/overwite behavior, both optional parameters with meaningful semantics, and the critical confirm/writes-enabled precondition. A capable agent can invoke this tool correctly with the provided details.

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

Parameters5/5

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

Schema description coverage is 0%, so the description does the required lift: 'document' is cast as a JSON object, doc_id's overwrite/auto-assign behavior is spelled out, refresh's trade-off is explained, and confirm's necessity is stated. Only 'index' is left implicit, but its role is obvious from the operation name.

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 clearly identifies the operation ('Index (create or overwrite) a single document into an index') and differentiates the tool from bulk, read, and query siblings by emphasizing 'single document'. It also states the core create-vs-overwrite behavior, which makes intent unambiguous.

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 gives clear operational context: pass a JSON document, use doc_id to overwrite, enable refresh for immediate visibility, and confirm that writes are enabled and confirm=true. It does not explicitly name sibling alternatives such as bulk_index, so guidance is strong but not exhaustive.

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