Skip to main content
Glama

db_query

Execute read-only SQL SELECT queries on databases to retrieve data with safety limits, supporting SQLite, PostgreSQL, and MySQL connections.

Instructions

Execute read-only SELECT query. Limited to 100 rows by default for safety.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesDatabase type
queryYesSQL SELECT query
connectionNoConnection string
hostNoDatabase host
portNoPort number
databaseNoDatabase name
userNoUsername
passwordNoPassword
limitNoMax rows (default 100)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it's read-only (indicating no mutations), has a safety limit (100 rows by default), and executes SELECT queries. However, it lacks details on error handling, response format, or timeouts, which would be helpful for a database tool.

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 front-loaded with the core purpose in the first sentence and adds a critical safety note in the second. Both sentences earn their place by providing essential information without redundancy, making it highly efficient and well-structured.

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 the tool's complexity (9 parameters, no output schema, and no annotations), the description is reasonably complete. It covers the read-only nature, safety limit, and query type, but could benefit from mentioning the return format or error scenarios. However, it adequately supports tool selection and invocation for a database query operation.

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 description coverage is 100%, so the schema already documents all 9 parameters thoroughly. The description adds minimal value beyond the schema by implying the 'limit' parameter's default (100 rows) and the query type (SELECT), but doesn't provide additional syntax or usage examples. This meets the baseline for high schema coverage.

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's purpose with a specific verb ('Execute') and resource ('read-only SELECT query'), distinguishing it from sibling tools like db_connect, db_explain, db_schema, and db_tables. It explicitly mentions the read-only nature, which differentiates it from potential write operations.

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?

The description implies usage context by stating 'read-only SELECT query' and 'Limited to 100 rows by default for safety,' suggesting it's for safe data retrieval. However, it doesn't explicitly state when to use this tool versus alternatives like db_explain or db_schema, nor does it mention prerequisites like needing a database connection.

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/ShunsukeHayashi/miyabi-mcp-bundle'

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