Skip to main content
Glama
cocaxcode

@cocaxcode/database-mcp

by cocaxcode

execute_query

Run SQL read queries (SELECT, SHOW) with auto-injected LIMIT and compressed results to save tokens; use inspect_last_query to retrieve full results later.

Instructions

Ejecuta una consulta de lectura (SELECT, SHOW, etc.). Inyecta LIMIT automaticamente. El result se comprime por defecto (verbosity=normal, celdas truncadas a 500 bytes) para ahorrar tokens; usa inspect_last_query con el call_id para recuperar el result completo sin re-ejecutar.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesConsulta SQL de lectura
limitNoLimite de filas (default: 100)
paramsNoParametros para prepared statement
verbosityNoControls result detail to save context tokens. Default: 'normal'. - 'minimal': Only rowCount, executionTimeMs, affectedRows, and preview of first row. USE FOR: INSERT/UPDATE/DELETE where you only need to confirm success, COUNT queries, health-style SQL ("SELECT 1"), polling a job status. SAVES: ~90-95% tokens. - 'normal' (DEFAULT): Full rows but each CELL truncated to max_cell_bytes. Preserves table structure. Cells flagged with trailing '…(+NB)' marker when truncated. USE FOR: most SELECT debugging — browsing tables with TEXT/JSONB columns, exploring data. SAVES: ~60-80% tokens on tables with large columns (content, html, json payloads). - 'full': Entire result untouched. SAME SHAPE AS pre-compression releases. USE FOR: when you explicitly need the complete value of every cell. If a cell is truncated you can call inspect_last_query({ call_id }) to recover the full result WITHOUT re-executing the SQL (preserves DB load and any side-effects).
only_columnsNoReturn only these columns from the result (client-side projection after fetch). Cheaper than full when the SQL already returned extra columns you don't need. Example: ["id", "title", "slug"] drops all other columns from the response.
max_cell_bytesNoMax bytes per cell for verbosity='normal' (default: 500). Cells longer than this are truncated with '…(+NB)' suffix. Ignored for minimal/full.
max_rows_in_responseNoCap rows returned to the agent (does NOT change the SQL LIMIT). Useful to peek at a big result. Default: no cap beyond SQL LIMIT.
include_schema_contextNoAñade un resumen del schema de las tablas referenciadas al final del output (default: true para 'full'/'normal', false para 'minimal'). Ponlo a false si ya conoces el schema.
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses automatic LIMIT injection, result compression behavior (verbosity levels, cell truncation), and the ability to recover full results via inspect_last_query. This is rich behavioral context beyond the schema, though it doesn't mention side effects or error handling details.

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?

Both the description and the verbosity parameter explanation are well-structured and front-loaded. The description is concise in the main description field, and the verbose parameter details are placed in the parameter descriptions where they belong, not bloating the top-level description. Every sentence earns its place.

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?

The tool is complex (8 params, multiple verbosity levels) and has no output schema, but the description compensates well by explaining the return behavior (compression, truncation markers, recovery path). It could mention what the result contains when compressed (e.g., return keys) but the verbosity parameter description already covers that. Missing explicit mention of error behavior or side effects, but for a read tool it's largely complete.

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 100%, so parameters are well-documented in the schema. The description adds value by explaining the verbosity levels' use cases and the compress-then-recover workflow, which goes beyond the schema's flat parameter descriptions. However, it doesn't reiterate every parameter since the schema already covers them.

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 'Ejecuta una consulta de lectura (SELECT, SHOW, etc.)' with a specific verb and resource type. It distinguishes from sibling execute_mutation by explicitly limiting to read operations, and mentions automatic LIMIT injection as a key behavior.

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 provides clear context for when to use this tool (read queries) and when to use inspect_last_query for full results without re-execution. However, it doesn't explicitly exclude write queries or name execute_mutation as the alternative for mutations, though the read-only framing implies it.

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/cocaxcode/database-mcp'

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