Skip to main content
Glama

execute_sql

Run a single SQL statement on a named database connection, returning columns and rows for SELECT queries or row count and insert ID for DML. Use positional parameters for PostgreSQL or MySQL.

Instructions

Execute a single SQL statement on a named connection. SELECT returns columns/rows; DML returns rowCount (and lastInsertId for mysql). Use positional params: $1.. for postgres, ? for mysql.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connection": "<connection>",
      "sql": "<sql>"
    },
    "name": "execute_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
paramsNopositional query parameters
databaseNodatabase to run against; defaults to the connection default
rowLimitNo
connectionYesconnection name, see list_connections

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations at all, the description carries the full disclosure burden. It does add real behavioral value by describing return shapes (columns/rows for SELECT, rowCount and mysql lastInsertId for DML), but it says nothing about permissions, transaction/autocommit semantics, or the destructive potential of DML/DDL through this tool.

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 short sentences, front-loaded with the core action, then return behavior, then parameter syntax. Every sentence carries distinct information and there is no filler.

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 five-parameter tool with no output schema, the description covers both return shape and parameter syntax, which is the essential information. It is slightly incomplete for a write-capable, fully unannotated tool in that it omits permission requirements and failure/error behavior.

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 60%, so the description must compensate, and it does for the most error-prone parameter by specifying placeholder syntax per dialect ($1.. for postgres, ? for mysql), which the schema's generic "positional query parameters" text does not convey. It says nothing about `database` or `rowLimit`, leaving part of the gap unfilled.

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 gives a specific verb and resource ("Execute a single SQL statement on a named connection") and constrains scope to one statement, which separates it from schema-inspection siblings like describe_table. It does not explicitly name a sibling alternative, so it falls just short of a 5.

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 rather than stated: "single SQL statement" tells the agent it cannot batch, and "named connection" implies a prior list_connections lookup. There is no explicit when-to-use or when-not-to-use guidance, and no alternative named for schema introspection or connection management.

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