Skip to main content
Glama

execute_sql

Destructive

Run SQL statements (SELECT, INSERT, UPDATE, DELETE, DDL) on a project's dedicated PostgreSQL database. Supports parameterized queries with $1, $2 placeholders for safety. Returns rows and count for SELECT, changes for mutations, or changes:0 for DDL.

Instructions

Run SQL against the project's dedicated PostgreSQL database.

Supports: CREATE TABLE, ALTER TABLE, DROP TABLE, INSERT, SELECT, UPDATE, DELETE. Use parameterized queries for safety: pass values in the params array with $1, $2, etc. placeholders.

Return format:

  • SELECT: { rows: [...], count: N } — DECIMAL columns return as strings (e.g. "45.00")

  • INSERT/UPDATE/DELETE: { changes: N }

  • DDL: { changes: 0 }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID (e.g. proj_a8Kq7fR2xZ)
sqlYesSQL statement to execute
paramsNoBind parameters (use $1, $2, etc. placeholders in SQL)
Behavior4/5

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

Annotations already mark this as destructive (destructiveHint: true), and the description adds that DDL operations are supported and return format details. It also notes that DECIMAL columns return as strings, which is valuable behavioral insight beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections for supported operations, parameter usage, and return formats. It is concise but informative, though the return format section could be slightly more compact.

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?

Given the tool's complexity (multiple SQL operations, return formats) and the absence of an output schema, the description adequately explains the behavior. It could mention error handling or transaction behavior, but it covers the core functionality well.

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?

The input schema has 100% coverage, so the description adds no parameter-level detail beyond what the schema provides. The description does explain how to use the params array with placeholders, which is helpful but does not substantially exceed the schema's own 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 clearly states the tool runs SQL against a dedicated PostgreSQL database. It lists supported SQL operations (CREATE TABLE, SELECT, etc.), making the purpose highly specific and distinguishing it from sibling tools like run_code or run_function.

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 explicit guidance on using parameterized queries for safety, which is a key usage guideline. However, it does not explicitly state when to use this tool versus alternatives like run_code or get_schema, though the context is clear.

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/Woobox/hatchable-mcp'

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