Skip to main content
Glama

query_d1

Execute SQL statements on a D1 database with bound parameters. Human approval gate ensures safety: set confirm:true to commit changes, otherwise preview results.

Instructions

Execute a SQL statement against a D1 database (with optional bound params). Requires confirm:true (human-approval gate); without it returns a preview only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idNoCloudflare account ID. Falls back to CLOUDFLARE_ACCOUNT_ID env var when omitted.
database_idYesD1 database ID (from list_d1_databases).
sqlYesThe SQL statement to execute.
paramsNoBound parameters for '?' placeholders in the SQL.
confirmNoHuman-approval gate: must be true to actually perform this mutating operation. Omit or set false to get a non-executing preview of what would happen (with secrets redacted). A human should approve before this is set to true.
Behavior5/5

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

Discloses the human-approval gate and preview behavior beyond what annotations provide. Aligns with annotations (readOnlyHint=false, destructiveHint=false) and adds critical context about mutation safety and preview functionality.

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 with no redundancy. Immediately conveys the core action and the key behavioral constraint (confirm gate). Every sentence is essential.

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?

While no output schema exists, the description explains the preview vs. execution difference. It could mention what the preview returns (e.g., rows affected), but the current level is sufficient for tool selection.

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

Parameters4/5

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

Schema coverage is 100%, but the description adds value by explaining the role of confirm as a 'human-approval gate' and preview mechanism. Also mentions fallback for account_id and the purpose of params, complementing the schema.

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 action ('Execute a SQL statement'), the resource ('D1 database'), and includes optional bound params. It distinguishes from sibling tools like list_d1_databases by focusing on execution rather than listing.

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

Usage Guidelines5/5

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

Explicitly states the requirement for confirm:true to actually execute, and that omitting it returns a preview. This provides clear when-to-use and when-not-to-use guidance, including the preview mode as a safe first step.

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/helbertparanhos/cloudflare-mcp-pro'

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