Skip to main content
Glama
mir-shakir

readonly-db-mcp

by mir-shakir

run_select

Execute a read-only SELECT query against a database, with optional pagination and schema selection. Rejects writes and DDL for safe exploration.

Instructions

Run a single read-only SELECT (or WITH...SELECT / UNION) against a database.

connection is a named server from your config (defaults to the configured default_connection). schema sets the default database/namespace for the query (defaults to that connection's default_schema); table names can still be schema- qualified to read across schemas on the same connection. Call list_connections() if unsure what's available, list_schemas(connection) to see schemas on one.

Writes, DDL, multiple statements, INTO OUTFILE and dangerous functions are rejected. Output is capped; when truncated is true, pass the suggested offset to page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
offsetNo
schemaNo
max_rowsNo
connectionNo
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: rejects writes, DDL, multiple statements, INTO OUTFILE, and dangerous functions; output is capped with pagination via offset; explains default connection and schema behavior. This is comprehensive.

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 a single well-structured paragraph, front-loaded with the main purpose, followed by parameter explanations and restrictions. Every sentence adds necessary information 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 (arbitrary SQL), no output schema, and no annotations, the description covers all essential aspects: purpose, limitations, parameter defaults, pagination, and references to sibling tools for discovery. It is sufficiently complete for correct tool invocation.

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 0%, so the description compensates by explaining connection and schema parameters in detail, including defaults and cross-schema access. It mentions offset for pagination but does not explicitly describe the max_rows parameter. Overall, adds significant value beyond the schema.

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 explicitly states the tool runs a read-only SELECT/WITH...SELECT/UNION query against a database, specifying the verb 'Run' and resource 'SELECT query'. It clearly distinguishes from sibling tools like list_tables or describe_table by focusing on arbitrary read-only SQL execution.

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 guides the agent to call list_connections() and list_schemas() for discovery, and states that writes/DDL are rejected. However, it does not explicitly exclude alternatives like explain or describe_table for specific use cases, but the context is clear enough.

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/mir-shakir/readonly-db-mcp'

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