Skip to main content
Glama

db_query

Read-onlyIdempotent

Execute read-only SQL SELECT queries against configured sqlite or MySQL/MariaDB databases. Supports row caps, output format selection, and requires a read-only database connection.

Instructions

Read-only SQL against a configured database profile (sqlite or mysql/MariaDB). DDL/DML blocked. Requires connections add-db --read-only; secrets via env:/secret only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSELECT query
repoNoRepository name
formatNotoon (default) | json
max_rowsNoRow cap (default 100)
connectionYesDatabase profile name
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. Description adds specifics about DDL/DML blocking and connection setup (secrets via env:/secret only), providing useful behavioral context beyond annotations.

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?

Two sentences, front-loaded with core action and resource. Every sentence adds essential information (read-only, DB types, blocked operations, prerequisites). No wasted words.

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?

Given well-documented schema and no output schema, description covers key aspects including constraints and prerequisites. Lacks mention of output format or error handling, but these are partially implied by format parameter and typical query 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?

Input schema has 100% coverage with all parameters described adequately. Description adds no extra parameter-level details beyond what schema already provides, resulting in baseline score.

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?

Clearly states it executes read-only SQL queries against configured databases, specifying database types (sqlite, mysql/MariaDB). This verb+resource definition distinguishes it from siblings like db_schema (schema retrieval) and generic query tool.

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?

Explicitly states read-only nature, blocks DDL/DML, and provides prerequisite connection requirements. Lacks explicit alternatives for schema queries (e.g., db_schema) but context is clear enough for correct selection.

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/VeyrForge/codehelper'

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