Skip to main content
Glama

Execute Database SQL

unfour.db.execute

Execute a single SQL statement on a saved database connection to fix dev/test data, using safety controls that block production writes and require confirmation for destructive queries.

Instructions

Executes one SQL statement against a saved database connection through the Unfour command bus. Use for INSERT/UPDATE/DELETE/DDL when an agent needs to repair dev/test data. Dev allows non-high-risk writes by default; test allows small writes but high-risk SQL requires confirm; prod blocks writes. DELETE/UPDATE without WHERE, DROP, TRUNCATE, ALTER, and multi-row destructive statements require a second call with the returned confirmation_text. Returns affectedRows, statementType, durationMs, and engine safety metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYes
limitNo
dryRunNo
schemaNo
catalogNo
confirmNo
timeoutMsNo
transactionNo
workspaceIdNo
connectionIdYes
confirmationTextNo
confirmation_textNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
rowsNo
dryRunYes
safetyNo
sourceYes
columnsNo
rowCountNo
truncatedNo
durationMsNo
transactionNo
affectedRowsNo
connectionIdYes
statementTypeYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.6.0
    • addedOutput schema / properties / transaction
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / truncated
      Added value: +{
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

The description provides extensive behavioral context beyond the annotations: environment-specific write permissions (dev default, test confirmation, prod blocked), a mandatory second-call confirmation flow for dangerous SQL, and details on return values (affectedRows, statementType, durationMs, engine safety metadata). This significantly enriches the minimal annotation set and is critical for safe, correct usage.

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?

Approximately 90 words across five sentences, each adding distinct value: purpose, usage scenario, environment rules, confirmation flow, and return payload. It is information-dense but efficient, with the core purpose front-loaded.

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?

For a high-complexity mutation tool with no schema descriptions, the description covers the essential operational aspects: what it does, when to use it, safety guardrails, and the confirmation protocol. It could expand on high-risk SQL specifics or `dryRun`/`transaction` behavior, but given it has an output schema and the description handles the most critical safety aspects, it is largely complete.

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?

With 0% schema description coverage, the description carries full responsibility for clarifying parameters. It clarifies the `confirmation_text`/`confirmationText` flow and implies `connectionId` and `sql`. However, it leaves the other nine parameters (dryRun, transaction, schema, catalog, etc.) unexplained, which is a significant gap given the total absence of schema descriptions.

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 uses a specific verb ('Executes'), a clear resource ('one SQL statement against a saved database connection'), and a mode ('through the Unfour command bus'). It clearly differentiates from siblings like `unfour.db.query_readonly` and `unfour.db.explain` by specifying it's for INSERT/UPDATE/DELETE/DDL and data repair.

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?

It explicitly states when to use the tool: 'Use for INSERT/UPDATE/DELETE/DDL when an agent needs to repair dev/test data.' It also sets expectations about behavior in dev/test/prod environments, which informs when the tool is applicable. However, it does not explicitly name the read-only alternatives like `unfour.db.query_readonly`.

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

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/zyqzyq/Unfour'

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