Skip to main content
Glama

sqlize.online

Run SQL

run_sql
Idempotent

Run a SQL script on a real database engine and return every result set and error. The database is fresh and empty (unless sql_version is a preloaded sample) and is dropped after the run, so include the CREATE TABLE and INSERT statements the queries need. Separate statements with semicolons. Results over 200 rows are cut. The answer links to the script on sqlize.online.

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": {
      "sql_version": "<sql_version>",
      "code": "<code>"
    },
    "name": "run_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe SQL script: one or more statements
sql_versionYesEngine and version, from list_databases (e.g. psql18, mysql84, mssql2022)
calculate_costNoAlso report the optimizer cost of each query, where the engine supports it

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing lifecycle behavior (fresh, empty database; dropped after the run), the preloaded-sample exception for sql_version, and the 200-row result cap. These are exactly the non-obvious traits an agent needs, and nothing contradicts the declared readOnlyHint=false / idempotentHint=true profile.

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?

Five short sentences, each carrying distinct operational information, with the critical lifecycle constraint front-loaded before formatting and limit details. No filler or repetition of the schema.

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?

With no output schema, the description carries the return-value burden and does so reasonably: every result set and error are returned, large results are truncated at 200 rows, and a link to the script is provided. It remains slightly thin on result formatting and on how calculate_cost surfaces in the response.

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?

Schema coverage is 100%, so the schema already documents all three parameters including the engine enum and calculate_cost. The description adds the useful semicolon-separation rule for `code` and the preloaded-sample notion for `sql_version`, but says nothing about calculate_cost's effect on output, so the baseline 3 is appropriate.

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 (run) and resource (SQL script) plus the execution environment (a real database engine) and what is returned (every result set and error). This clearly separates it from sibling tools like describe_database and list_databases, which inspect rather than execute.

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?

Gives essential operating instructions: the database starts empty and is dropped after the run, so the script must include CREATE TABLE and INSERT statements, and statements must be separated by semicolons. It stops short of explicitly contrasting with describe_database/list_databases, but the execution-vs-inspection distinction is clear from context.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources