Skip to main content
Glama

Run OpenSearch DSL query

search_dsl
Read-only

Execute raw OpenSearch DSL queries to retrieve hits and aggregations, giving full control over the query and aggregation bodies while respecting time filters inside the DSL.

Instructions

Run a raw OpenSearch DSL query and return its hits plus aggregations.

    Use this for full DSL control over the query and aggregation bodies. When you
    only need a match count and not the documents, use count. For Malcolm's
    simpler field-filter syntax instead of raw DSL, use malcolm_search.
    Aggregations honor the time filter inside the DSL body, so there is no hidden
    default time window. Returns the raw OpenSearch _search response.

    Both input guards run before any request leaves this server: malformed
    query_dsl, and an index containing /, ? or .., are refused as input
    errors rather than costing an upstream scan. When the query is easier to
    say as an Arkime expression, compile it with arkime_build_query and hand
    the index and query_dsl it returns straight to this tool — serialise its
    query_dsl object to a JSON string first, which is what this parameter
    declares.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoMax hits to return; 0 for aggregation-only. Always overrides any "size" key inside query_dsl.
indexYesIndex or pattern to query, e.g. "arkime_sessions3-*". Accepts a wildcard; must contain no path metachars (/, ?, ..).
query_dslYesJSON string of a full DSL body, e.g. {"query": {...}, "aggs": {...}}. A bare query object with no "query" key is wrapped as {"query": ...} for you.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds valuable behavior: aggregations honor the DSL time filter, input guards reject malformed query_dsl and path metacharacters, and the tool returns the raw _search response. No contradiction with 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?

The description is long but every sentence earns its place: purpose, usage, behavior, guards, and integration. It is front-loaded with the main purpose and flows logically without redundancy.

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 complexity, annotations, output schema, and many siblings, the description covers all essential aspects: what it returns, when to use it, error behavior, and how to interoperate with arkime_build_query. Nothing critical is missing.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds extra context beyond the schema—such as serializing the query_dsl object from arkime_build_query and noting the index guard—but most parameter meaning is already in the schema. Small added value justifies a 4.

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: 'Run a raw OpenSearch DSL query and return its hits plus aggregations.' It also names sibling alternatives (count, malcolm_search, arkime_build_query), clearly distinguishing this tool's role.

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?

Provides explicit when-to-use ('Use this for full DSL control') and when-not-to-use guidance with named alternatives ('use count', 'use malcolm_search', 'use arkime_build_query'). This is exemplary usage guidance.

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/nagameTW/mcp-server-malcolm'

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