Skip to main content
Glama
opensearch-project

opensearch-mcp-server-py

Official

SearchIndexTool

Search an OpenSearch index using query DSL to retrieve matching documents. Provide the index name and query to obtain results in JSON or CSV.

Instructions

Searches an index using a query written in query domain-specific language (DSL) in OpenSearch. PREREQUISITE: You need to know the mappings of the index before constructing queries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoNumber of search results to return. The maximum allowed value is 100, unless overridden by configuration.
indexYesThe name of the index to search in
formatNoOutput format: "json" or "csv"json
query_dslYesThe search query in OpenSearch query DSL format. For keyword-type fields (mapping shows "type": "keyword"), use field name DIRECTLY - do NOT add .keyword suffix. For text-type fields with .keyword subfields, use the .keyword suffix for exact matches. For date/time range queries, MUST include "format" parameter (commonly "format": "strict_date_optional_time||epoch_millis"), e.g. {"range": {"timestamp": {"gte": "2025-12-29T17:15:12Z", "lte": "2025-12-30T08:15:12Z", "format": "strict_date_optional_time||epoch_millis"}}}; if using non-ISO formats, adjust "format" accordingly.
aws_regionNoAWS region for IAM/Serverless authentication.
aws_iam_arnNoIAM role ARN for role-based authentication.
aws_profileNoAWS profile name for authentication.
opensearch_urlYesOpenSearch endpoint URL.
opensearch_no_authNoIf true, connect without authentication.
opensearch_timeoutNoConnection timeout in seconds.
opensearch_passwordNoPassword for basic authentication.
opensearch_usernameNoUsername for basic authentication.
opensearch_ssl_verifyNoSet true to require SSL certificate verification. A false value is ignored, since only the operator may disable verification.
aws_opensearch_serverlessNoIf true, use OpenSearch Serverless service.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.12.0
    • changedInput schema / properties / opensearch_ssl_verify / description
      Previous value: -"If false, disable SSL certificate verification."New value: +"Set true to require SSL certificate verification. A false value is ignored, since only the operator may disable verification."
  2. First observedv0.9.0

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but does not mention authentication requirements (despite multiple auth parameters), output format (though schema has a 'format' param), pagination, error behavior, or that results are returned. The prerequisite about mappings hints at a precondition but is minimal. For a tool with 14 parameters including auth, this is a significant gap.

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

Conciseness4/5

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

The description is one concise sentence plus a prerequisite note. It is front-loaded with the core action and avoids redundancy. The prerequisite is clearly marked. No wasted words, though it could be slightly more structured with separate usage guidance sections.

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

Completeness2/5

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

This is a complex tool with 14 parameters covering multiple authentication methods, timeouts, and output formats, and it has no output schema. The description only mentions the action and a prerequisite, but does not guide the agent on which auth parameters to choose (e.g., when to set opensearch_no_auth vs. providing credentials), nor does it describe the return structure or pagination. Given the tool's complexity and absence of annotations/output schema, the description is insufficiently complete for an agent to call it correctly without additional investigation.

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 all parameters in detail, including the rich query_dsl parameter with examples and rules about keyword suffixes and date formats. The tool description adds the prerequisite about mappings, which is helpful context for query construction, but does not add further parameter semantics beyond what the schema provides. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'Searches an index using a query written in query DSL'. It is specific about the resource (index) and the method (query DSL). However, it does not explicitly differentiate from siblings like MsearchTool (multi-search) or CountTool (count only), relying on the tool name and basic phrasing to imply single-index search.

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 description provides a clear prerequisite: 'You need to know the mappings of the index before constructing queries.' This is useful guidance. However, it offers no comparison to alternative tools (e.g., when to use this vs. MsearchTool or CountTool) and no exclusions. The prerequisite is the only usage hint, leaving selection to the agent's inference.

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