Skip to main content
Glama
dmayan-ss

mcp-opensearch

by dmayan-ss

count

Determine the number of documents in an OpenSearch index or pattern, optionally filtered by a query to narrow the count to specific records.

Instructions

Count documents in an index, optionally filtered by a query.

Args: index: Index name or pattern (e.g. 'logs-*'). query_body: Optional JSON string with a query filter (e.g. '{"query": {"match": {"level": "ERROR"}}}').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes
query_bodyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It clearly states that this is a count operation, accepts index patterns like 'logs-*', and treats query_body as an optional JSON query filter. Error behavior and edge cases are not covered, but the simple read-only nature of the operation is sufficiently disclosed.

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 a single clear summary line followed by two terse argument explanations, each with a useful example. There is no filler, and the most important information is front-loaded.

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

Completeness4/5

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

For a simple two-parameter count operation with an output schema present, both inputs are fully explained and the behavior is clear. The main missing element is explicit guidance about when to choose this over search, but that is more of a usage-guideline concern than a completeness gap.

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 fully compensates. The Args section defines index as a name or pattern with an example, and query_body as an optional JSON string with a concrete match example. This adds real semantic meaning well beyond the bare schema types.

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 specific verb and resource: 'Count documents in an index,' and adds the optional query-filtering capability. This clearly distinguishes it from siblings like search (which retrieves documents) and list_indices (which lists indices), so an agent knows exactly what this tool does.

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 counting use case is clear, but the description never explicitly tells an agent when to prefer this tool over search or another sibling. The guidance is implied by 'optionally filtered by a query,' but there are no stated exclusions or alternative-routing hints.

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