Skip to main content
Glama
arkty

@arkty/redash-mcp

by arkty

execute_adhoc_query

Read-only

Run SQL SELECT queries directly against a data source for results without saving or leaving traces. Destructive SQL is blocked for safe ad-hoc exploration.

Instructions

Execute a SQL query directly against a data source. No query object is created in Redash — leaves no trace. Destructive SQL (INSERT/UPDATE/DELETE/DROP etc.) is blocked. For running queries this is the DEFAULT tool. Use create_query only when user explicitly asks to save a query to Redash web UI.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSQL query to execute (SELECT only)
formatNoResult format: 'json' returns data in response, 'csv' saves to file and returns file pathjson
output_pathNoCustom file path for CSV output. If omitted, saves to cwd as adhoc_{timestamp}.csv
data_source_idNoData source ID (from list_data_sources). Optional if REDASH_DEFAULT_DATA_SOURCE_ID is set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true, but the description adds valuable behavioral detail: it blocks destructive SQL and leaves no trace, which goes beyond the annotation. It does not cover every possible side effect (e.g., performance or locking), but it provides meaningful context that helps an agent anticipate behavior. Since annotations carry the read-only flag, this additional context earns a 4.

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?

Three sentences with zero redundancy. The core action is front-loaded, followed by the no-trace guarantee and the destructive-SQL block, then the usage recommendation and alternative. Every sentence earns its place and the structure is logical and skimmable.

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?

The description covers the tool's purpose, its side-effect-free nature, the destructive block, and the decision between this and create_query. It does not detail return formats, but the schema already documents format and output_path. It also references data_source_id via list_data_sources in the schema, and siblings include that tool. Minor gaps (e.g., pagination or error handling) are not critical for a straightforward query executor, so a 4 is warranted.

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%—all four parameters have descriptive text in the schema. The description itself adds no parameter-specific guidance beyond what the schema already provides, such as the format behavior (csv saves to file) which is already in the schema. Baseline of 3 is appropriate when the schema fully documents parameters.

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 precise verb and resource: 'Execute a SQL query directly against a data source.' It immediately differentiates itself from the sibling create_query by noting 'no query object is created in Redash — leaves no trace.' This unambiguously identifies what the tool does and how it differs from related tools.

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?

Explicit usage direction is provided: 'For running queries this is the DEFAULT tool. Use create_query only when user explicitly asks to save a query to Redash web UI.' This states exactly when to use this tool and when to prefer the alternative, leaving no ambiguity for an agent.

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