Skip to main content
Glama
agrica

elasticsearch7-mcp

by agrica

Count documents

count
Read-onlyIdempotent

Count documents matching a query in an Elasticsearch index without transferring results. Get the exact number quickly, saving resources when only the total matters.

Instructions

Count the documents matching a query, without transferring any. Cheaper than search when only the number matters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYesIndex to count in
queryNoQuery DSL. Omit to count every document.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.4.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, and non-destructive behavior. The description adds useful behavioral context beyond annotations: no documents are transferred and this operation is cheaper than search. This is meaningful information without contradicting the annotations.

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?

Two short sentences with no redundant words. The core action is front-loaded and the benefit/alternative is stated in the second sentence.

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 simple read-only counting tool, the description, schema, and annotations together cover the required parameters, the optional query behavior, the safety profile, and the use case. The return value (a count) is obvious from the tool's purpose, so no output schema is needed.

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 the schema already documents index and query, including that omitting query counts every document. The description does not add further parameter-level meaning but does not need to.

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 uses a specific verb-resource pairing ('Count the documents matching a query') and immediately differentiates from the sibling search tool by noting it transfers no documents. An agent can tell exactly what operation this performs and how it differs from search.

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

Usage Guidelines5/5

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

It explicitly states the condition for choosing count over search: 'when only the number matters,' and notes it is 'Cheaper than search.' The phrase 'without transferring any' also implies that search should be used when actual documents are needed.

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