Skip to main content
Glama
bunnyiesart

mcp-opensearch

by bunnyiesart

opensearch_count

Count documents in an OpenSearch index matching a query. Specify optional time range and Lucene query string. Returns only the count, never document content.

Instructions

Fastest way to check how many documents match a condition; never returns content.

Prefer over opensearch_search when you only need the count — it never fills context with document data. Without from_ts/to_ts, scans the full index (4–5 s on 50 M docs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYesIndex name or wildcard pattern.
to_tsNoEnd time, UTC ISO 8601.
from_tsNoStart time, UTC ISO 8601.
ts_fieldNoTimestamp field name (default "@timestamp").@timestamp
query_stringNoLucene query string (default "*" = all documents).*

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations, the description does well to disclose key behaviors: never returns content, and full index scan timing. Could mention that it returns a single count value, but output schema likely covers that.

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 sentences, efficient and front-loaded with the most important information about purpose and when to use. No wasted words.

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 tool's simplicity and presence of an output schema, the description covers all necessary context: what it does, when to use it, and a performance note. No gaps.

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 coverage is 100%, so baseline is 3. Description does not add significant meaning beyond what is already in the schema for parameters like from_ts, to_ts, query_string, etc.

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 states it is the fastest way to count documents matching a condition and explicitly says it never returns content. This distinguishes it from sibling tools like opensearch_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?

Directly advises to prefer this tool over opensearch_search when only a count is needed, and provides performance context about full index scan duration when time filters are omitted.

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/bunnyiesart/mcp-opensearch'

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