Skip to main content
Glama
thhart

database-mcp

by thhart

query

Execute SQL queries on a profile and retrieve results with pagination. Returns columns, rows, and a cursor to fetch additional pages without re-executing the query.

Instructions

Execute SQL on a profile (default profile when omitted). Returns the first page as compact {"columns":[...],"rows":[[...],...],"page":{"returned","has_more","estimated_rows","cursor"}}. When has_more is true, pass page.cursor to the fetch tool — the query is NOT re-executed; a server-side cursor is held open (stable snapshot). Placeholders: %s positional with the params array.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo
profileNo
page_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the first-page return format, the has_more flag, the server-side cursor held open with a stable snapshot, and the placeholder convention. This goes beyond the schema and gives the agent essential behavioral knowledge. It omits details on permissions or error handling, but for a query tool the core behaviors are covered.

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 a single, efficient paragraph that front-loads the purpose, then explains pagination and placeholders in logical order. Every sentence adds value with no redundancy, and the structure makes it easy for an agent to parse quickly.

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?

The description covers the key behavioral aspects: pagination, cursor semantics, placeholders, and default profile. The output schema exists, so return-value details are not needed. However, it omits page_size entirely and does not provide guidance on SQL limitations or when to use this tool versus siblings. Given the complexity of 4 parameters and no annotations, this is a notable but not critical gap.

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?

The schema has 0% description coverage, so the description must compensate. It explains sql implicitly as the query text, params as the positional %s placeholders, and profile via the 'default profile' mention. However, page_size is completely undocumented in both the schema and the description, leaving its purpose and usage unclear. This is a significant gap for a four-parameter tool.

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 explicitly states 'Execute SQL on a profile', making the verb and resource clear. It also explains the default profile behavior and the pagination mechanism, which distinguishes this from sibling tools like tables or describe by focusing on arbitrary SQL execution. This gives the agent a precise understanding of the tool's role.

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 on using the default profile and explicitly instructs to pass the cursor to the fetch tool when has_more is true, establishing a clear pagination workflow. However, it does not explicitly differentiate when to use this tool versus alternatives like explain or count, nor does it state any exclusions. Still, the pagination guidance is a strong usage cue.

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

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