Skip to main content
Glama

run_query

Read-only

Execute SQL queries against Redash data sources and return results as tables or JSON. Configure cache TTL and query timeout.

Instructions

Execute SQL against a data source and return results. Check schema with list_tables and get_table_columns first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_source_idYesData source ID from list_data_sources
queryYesSQL query to execute
max_ageNoRedash cache TTL in seconds (0 to 604800). Defaults to REDASH_DEFAULT_MAX_AGE env var
max_rowsNoMax rows to return (1 to 10000, default 100)
formatNoOutput format: table (markdown) or jsontable
timeout_secsNoQuery execution timeout in seconds (1 to 300, default 30)
Behavior2/5

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

Annotations declare readOnlyHint=true, so the description need not restate that, but it adds no detail about authentication, rate limits, or behavior on errors. The description remains generic about execution semantics.

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?

Two sentences, front-loaded purpose, no fluff. Every sentence adds value: first states action, second gives prerequisite guidance.

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

Completeness3/5

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

Given 6 parameters and no output schema, the description is too brief. It lacks information about result structure, error states, or behavior with large datasets, which would help agents handle edge cases.

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

Parameters2/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, but the description does not add any additional context beyond what's in the schema fields. It misses opportunities to explain parameter interdependencies or usage nuances.

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 states 'Execute SQL against a data source and return results' with a clear verb and resource. It also directs users to check schema first, distinguishing it from schema-listing siblings like list_tables and get_table_columns.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises checking schema first with list_tables and get_table_columns, providing usage guidance. However, it does not explain when to use this tool versus alternatives like get_query_result or evaluate_queries, though the sibling list implies differentiation.

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/seob717/redash-mcp'

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