Skip to main content
Glama

db_query

Read-onlyIdempotent

Execute one read-only SELECT, SHOW, DESCRIBE, or EXPLAIN statement on the configured MySQL/MariaDB database, returning up to the requested row limit.

Instructions

One SELECT/SHOW/DESCRIBE/EXPLAIN statement on the configured MySQL/MariaDB (read-only user).

Input Schema

NameRequiredDescriptionDefault
sqlYes
max_rowsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.2

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, but the description adds constraints the annotations do not convey: a single statement per call, a whitelist of statement types, and that the underlying account is a read-only user. It leaves out row-cap behavior, truncation, and error semantics for rejected statements.

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?

A single front-loaded sentence with no filler; the whitelist of statement types is the most decision-relevant fact in the definition.

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?

An output schema exists so return values need not be explained, and the safety/statement constraints are covered. The one real gap is the undocumented max_rows truncation behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning. It partly explains the 'sql' parameter via 'One statement' and the allowed statement types, but says nothing about 'max_rows' or its default of 100, leaving the row-limit behavior completely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the resource (MySQL/MariaDB) and enumerates the exact statement types permitted (SELECT/SHOW/DESCRIBE/EXPLAIN), so an agent knows precisely what the tool executes. It stops short of naming it as the only database sibling, but the surrounding siblings are filesystem/service tools, making overlap unlikely.

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 implies when-not-to-use by restricting to read statements under a read-only user, and the 'One ... statement' phrasing rules out batched SQL. There is no explicit guidance about when to choose this over, say, read_file or run_command for data inspection, nor about what happens when a write statement is submitted.

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