Skip to main content
Glama

db_query

Run SQL queries (SELECT, INSERT, UPDATE, DELETE) against a named database to retrieve or modify data. Use LIMIT for read-only queries to limit returned rows.

Instructions

在指定数据库上执行 SQL 查询(SELECT/INSERT/UPDATE/DELETE)。只读查询建议添加 LIMIT

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes要执行的 SQL 语句。只读查询建议添加 LIMIT 子句
maxRowsNo最大返回行数,默认 100
databaseYes数据库名称,对应 .env 中 DATABASES 配置的 name 字段
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose that the tool can perform writes and deletes (INSERT/UPDATE/DELETE) and hints at large result sets via the LIMIT recommendation. However, it omits important behavioral context such as whether mutations are immediately committed, whether confirmation is required, or what the response looks like.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief, front-loaded with the core purpose, and contains no filler. The LIMIT recommendation is useful but slightly redundant with the schema description, so it does not earn a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 3-parameter tool with fully documented schema properties, this description is mostly adequate. Missing context includes the return format for writes, error behavior, and how this tool relates to the specialized database listing siblings.

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 three parameters. The description adds no new parameter-level semantics; the LIMIT advice is also present in the query parameter description.

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 clearly states it executes SQL queries on a specified database, listing the supported statement types (SELECT/INSERT/UPDATE/DELETE). It implicitly differentiates from sibling list-only tools like db_list_databases and db_list_tables, though it does not explicitly name them.

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

Usage Guidelines2/5

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

The only usage guidance is recommending LIMIT for read-only queries. There is no explicit direction on when to choose this generic SQL tool over specialized siblings, nor any when-not-to-use guidance for potentially destructive operations.

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/rowanlin-dev/cloud-ops-mcp'

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