Skip to main content
Glama
nandanosql

database-explorer-mcp

by nandanosql

run_query

Execute SQL or MongoDB queries against PostgreSQL, MySQL, SQLite, and MongoDB databases; destructive writes are blocked by default.

Instructions

Execute a SQL query (PostgreSQL/MySQL/SQLite) or MongoDB query (JSON format). For SQL databases: provide standard SQL. For MongoDB: provide JSON like {"collection":"users","operation":"find","query":{"age":{"$gt":25}},"options":{"limit":10}}. MongoDB operations: find, aggregate, count, distinct. Results are limited to 100 rows by default (max 1000). By default, destructive queries (DROP, TRUNCATE, INSERT, UPDATE, DELETE) are blocked. Set readonly=false to allow writes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax rows to return (default: 100, max: 1000)
queryYesSQL query or MongoDB JSON query
readonlyNoBlock destructive queries (default: true). Set to false to allow writes.
connectionNoConnection alias (default: 'default')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the default row cap (100), the hard max (1000), which operations are blocked by default (DROP/TRUNCATE/INSERT/UPDATE/DELETE), and the exact flag that unlocks writes. It stops short of describing permissions needed or what a write returns.

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?

Front-loaded with the core action, then organized by dialect, then limits, then safety default. Every sentence carries distinct information and the inline JSON example is the most efficient way to convey the Mongo format.

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?

Covers dialect formats, result-size limits, and the destructive-query safety model for a 4-parameter tool with no annotations and no output schema. Minor gaps remain around error behavior and whether writes return affected-row counts, but the operational essentials are present.

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 coverage is already 100%, so the baseline is 3, but the description adds real meaning beyond the schema: a concrete MongoDB JSON shape with collection/operation/query/options keys and the list of supported Mongo operations. That goes beyond the schema's terse 'SQL query or MongoDB JSON query'.

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?

States a specific verb (Execute) and resource (SQL / MongoDB query) and immediately scopes the two supported dialects with format examples. An agent can distinguish this from siblings like explain_query, search_data, and export_data without opening any schema.

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

Usage Guidelines3/5

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

It gives a clear condition for the readonly flag ('by default destructive queries are blocked; set readonly=false to allow writes'), which is useful usage guidance. However, it never routes the agent to alternatives such as explain_query for plan inspection or search_data for filtering, and no when-not-to-use case is stated.

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