Skip to main content
Glama
dicoy

sqlens-mcp

by dicoy

run_query

Execute read-only SQL SELECT or WITH queries on local databases. Returns results as a formatted table with optional parameters and row limits.

Instructions

Execute a read-only SELECT query and return results as a formatted table. Only SELECT and WITH statements are permitted.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL SELECT statement to execute. Only read-only queries are permitted.
paramsNoPositional parameters for parameterized queries ($1/$2 in Postgres, ? in MySQL/SQLite)
max_rowsNoMaximum rows to return (default 50, max 500)
connectionNoNamed connection to use. Defaults to the default connection.
Behavior3/5

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

The description states it is read-only and returns formatted table, but with no annotations, it leaves gaps about error handling, timeout, multiple statements, and exact output format. It adds modest value over the schema.

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, focused sentence that efficiently conveys the core functionality and constraint. No wasted words.

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 the tool has 4 parameters and no output schema, the description provides adequate context for the purpose but lacks details on return format, error handling, and query execution behavior.

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 coverage is 100%, so the description adds no additional parameter meaning beyond the schema definitions. The description does not elaborate on how parameters are used or constraints beyond 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 clearly states the tool executes a read-only SELECT query and returns results as a formatted table, specifying only SELECT and WITH statements are permitted, which distinguishes it from sibling tools like describe_table, explain_query, etc.

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 limits usage to SELECT and WITH statements, indicating when not to use (e.g., DML statements). However, it does not provide guidance on when to prefer run_query over sibling tools like explain_query for analysis.

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/dicoy/sqlens-mcp'

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