Skip to main content
Glama
questdb

mcp-server-questdb

Official

run_query

Execute SQL against QuestDB and retrieve result rows with configurable limit (up to 10,000) to inspect data, validate work, or compose follow-up queries. Handles DDL/DML as well.

Instructions

Execute an arbitrary SQL statement against the user's QuestDB instance and return the result rows so you can inspect data, validate work, or compose follow-up queries. UNLIKE run_cell, this tool DOES return data values. Default limit is 100 rows; pass limit (max 10000) to request more. The response payload is capped at ~1 MB — rows beyond that are dropped from the tail. The response includes truncated, total_count, and returned_count so you know exactly what was clipped. DDL/DML (CREATE / INSERT / UPDATE / DROP / etc.) is allowed and executes against the live database — be deliberate. Auth + connection are handled by the user's already-authenticated browser session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL statement to execute.
limitYesMaximum rows to return (default 100, max 10000). Pass null for default.
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 of disclosing behavior. It covers row limit defaults, payload size cap, truncation behavior, response fields (`truncated`, `total_count`, `returned_count`), the fact that DDL/DML executes live, and that authentication is handled by the user's session. This is exemplary transparency.

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 every sentence earns its place: purpose, comparison to `run_cell`, limit behavior, truncation, response fields, mutation warning, and auth context. It is front-loaded with the core purpose and uses clear warnings like 'be deliberate'.

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?

For a tool that executes arbitrary SQL with mutation potential and pagination/truncation nuances, the description covers all essential context: what data is returned, how limits work, what happens when the payload is too large, and that DDL/DML mutates the live database. No output schema exists, so describing the response fields (`truncated`, `total_count`, `returned_count`) is important and done well.

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?

The input schema already fully describes both parameters (`sql` and `limit`) with 100% coverage, including default and max for `limit`. The description reinforces this by mentioning default limit 100 and max 10000, but does not add significant new parameter-level meaning beyond what the schema provides.

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 clearly states the tool's function: executing arbitrary SQL against QuestDB and returning result rows. It distinguishes itself from the sibling `run_cell` by explicitly noting that unlike `run_cell`, this tool returns data values.

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?

The description explicitly contrasts with `run_cell`, clarifying when to use this tool (when you need data back) versus the alternative. It also gives use cases: inspect data, validate work, compose follow-up queries. This is strong when/when-not 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/questdb/mcp-server-questdb'

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