Skip to main content
Glama
deslicer

MCP Server for Splunk

by deslicer

Run Splunk Search

run_splunk_search

Execute Splunk searches as tracked jobs with progress and stats. Use for complex or long-running queries needing job status, counts, and reliable result retrieval beyond 30 seconds.

Instructions

Run a Splunk search as a tracked job with progress and stats. Use this for complex or long‑running queries (joins, transforms, large scans) where you need job status, scan/event counts, and reliable result retrieval. Prefer this over oneshot when the query may exceed ~30s or requires progress visibility.

Waits up to MCP_SEARCH_WAIT_SECONDS (default 15) then returns job_id even if the job is still running. If is_done is false, poll get_search_job_info, then get_search_job_results. If has_more is true after completion, page with offset=next_offset. count/max_results of 0 is treated as the default page size (50), max 100. Security: results are constrained by the authenticated user's permissions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
queryYesThe Splunk search query (SPL) to execute. Can be any valid SPL command or pipeline. Supports complex searches with transforming commands, joins, and subsearches. Examples: 'index=* | stats count by sourcetype', 'search error | eval severity=case(...)' earliest_time (str, optional): Search start time in Splunk time format. Examples: '-24h', '-7d@d', '2023-01-01T00:00:00' Default: '-24h' latest_time (str, optional): Search end time in Splunk time format. Examples: 'now', '-1h', '@d', '2023-01-01T23:59:59' Default: 'now' count (int, optional): Page size 1-100 (default 50; 0 uses default)
offsetNoResult offset (default 0)
latest_timeNonow
max_resultsNoDeprecated alias for count
earliest_timeNo-24h

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.12
    • changedInput schema / properties / query / description
      Previous value: -"The Splunk search query (SPL) to execute. Can be any valid SPL command                or pipeline. Supports complex searches with transforming commands, joins,                and subsearches. Examples: 'index=* | stats count by sourcetype',                'search error | eval severity=case(...)'    earliest_time (str, optional): Search start time in Splunk time format.                Examples: '-24h', '-7d@d', '2023-01-01T00:00:00'                Default: '-24h'    latest_time (str, optional): Search end time in Splunk time format.                Examples: 'now', '-1h', '@d', '2023-01-01T23:59:59'                Default: 'now'    count (int, optional): Page size 1-100 (default 50)"New value: +"The Splunk search query (SPL) to execute. Can be any valid SPL command                or pipeline. Supports complex searches with transforming commands, joins,                and subsearches. Examples: 'index=* | stats count by sourcetype',                'search error | eval severity=case(...)'    earliest_time (str, optional): Search start time in Splunk time format.                Examples: '-24h', '-7d@d', '2023-01-01T00:00:00'                Default: '-24h'    latest_time (str, optional): Search end time in Splunk time format.                Examples: 'now', '-1h', '@d', '2023-01-01T23:59:59'                Default: 'now'    count (int, optional): Page size 1-100 (default 50; 0 uses default)"
  2. Changed4 schema fields changedv0.6.11
    • addedInput schema / properties / count
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / max_results
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Deprecated alias for count"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "Result offset (default 0)",
      +  "type": "integer"
      +}
    • addedInput schema / properties / query / description
      Added value: +"The Splunk search query (SPL) to execute. Can be any valid SPL command                or pipeline. Supports complex searches with transforming commands, joins,                and subsearches. Examples: 'index=* | stats count by sourcetype',                'search error | eval severity=case(...)'    earliest_time (str, optional): Search start time in Splunk time format.                Examples: '-24h', '-7d@d', '2023-01-01T00:00:00'                Default: '-24h'    latest_time (str, optional): Search end time in Splunk time format.                Examples: 'now', '-1h', '@d', '2023-01-01T23:59:59'                Default: 'now'    count (int, optional): Page size 1-100 (default 50)"
  3. Changed1 schema field changedv0.5.1
    • addedInput schema / additionalProperties
      Added value: +false
  4. First observedv0.5.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly: it discloses the MCP_SEARCH_WAIT_SECONDS timeout, that job_id is returned even if still running, the is_done/has_more/next_offset paging contract, count/max_results semantics, and permission-based result constraints. This is rich behavioral context beyond what any schema provides.

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 dense but efficient: every sentence earns its place. It front-loads the core purpose, then gives the decision rule, async behavior, pagination flow, parameter semantics, and security note without redundancy or filler.

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?

Despite having no output schema, the description covers the full invocation lifecycle: selecting when to use it, calling it, interpreting is_done, polling via get_search_job_info/get_search_job_results, paginating with offset, and understanding permission constraints. Nothing essential is missing for an agent to use it correctly.

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 coverage is only 50%, so the description compensates by explaining count/max_results (0 means default page size 50, max 100), earliest/latest_time defaults and formats within the query parameter description, and offset usage. This adds meaning beyond the bare schema fields.

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 Splunk search as a tracked job with progress and stats.' It clearly distinguishes this tool from run_oneshot_search by emphasizing job tracking, progress visibility, and reliable result retrieval for complex or long-running queries.

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 when to use this tool ('complex or long-running queries... where you need job status') and names the alternative ('Prefer this over oneshot when the query may exceed ~30s or requires progress visibility'). It also gives the polling workflow, so an agent knows exactly how to follow up.

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