Skip to main content
Glama

cf_d1_query

Execute SELECT/INSERT/UPDATE/DDL SQL against a Cloudflare D1 database by name or ID with parameter binding, returning rows, affected rows, and duration.

Instructions

Execute a SQL statement (SELECT/INSERT/UPDATE/DDL) against a named D1 database or database id. Returns columns, rows, rows_affected and duration. Supports positional parameter binding on the REST path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
paramsNo
databaseYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNo
errorNo
resultNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the return fields (columns, rows, rows_affected, duration) and notes positional parameter binding 'on the REST path', and names DDL/UPDATE/INSERT so the agent can infer mutation. It does not state permission requirements, reversibility, or error behavior for a destructive-capable tool, so it is only partially transparent.

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?

Three tight sentences with zero filler; the core action and target lead, with the return shape and binding note following. Every sentence earns its place.

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?

An output schema exists, so return values need not be restated, and the description nevertheless names them. Params are covered despite 0% schema coverage. The remaining gap is the absence of any safety/permission context for a tool that accepts INSERT/UPDATE/DDL.

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 description coverage is 0%, so the description must compensate. It clarifies that 'database' accepts a name or an id and that 'params' performs positional binding on the REST path, adding meaning beyond the bare schema for two of three parameters (the third, 'sql', is self-evident).

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?

States a specific verb (Execute) and resource (a SQL statement against a named D1 database or database id), and enumerates the statement classes (SELECT/INSERT/UPDATE/DDL). An agent can distinguish this from cf_d1_list_databases and cf_d1_schema without opening the schema.

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?

Usage is implied by the verb and statement types but there is no explicit when-to-use guidance, no exclusions, and no pointer to siblings like cf_d1_schema for introspection or cf_d1_list_databases for discovery. Nothing misleading, but nothing routing either.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.