Skip to main content
Glama
platypus-db

platypus-db

Official

run_query

Execute one SQL statement on a saved database connection and get rows back as an aligned text table or JSON, with row and byte limits and cursor paging for large results.

Instructions

Runs one SQL statement on a connection and returns its rows as an aligned text table (or JSON with format=json, where integers beyond 2^53 are strings so that no JSON parser rounds them), saying when rows or long values were left out. In the text table SQL NULL is NULL, and a text that reads NULL shows quoted, 'NULL'. Defaults: 100 rows, 32768 bytes, 30 s timeout; max_rows, max_bytes and timeout_seconds raise them up to 10000 rows, 1048576 bytes and 300 s. On read_only connections only statements that change nothing run, in a read-only transaction; on read_write connections changes commit at once, and UPDATE or DELETE without WHERE is refused unless the user's safety settings allow it. Use the database's own SQL dialect. A result cut by max_rows or max_bytes returns a cursor (the cursor field in JSON) for next_page to read the rest.

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": "run_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne SQL statement.
formatNo`text` (an aligned table, the default) or `json`.
max_rowsNoRows returned at most (default 100, up to 10000).
max_bytesNoBytes of output at most (default 32768, up to 1048576).
connectionYesThe connection's name, as `list_connections` shows it.
timeout_secondsNoSeconds the statement may run before it is cancelled (default 30, up to 300).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.2

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: read-only transactions, immediate commits on read_write, safety refusal for WHERE-less mutations, truncation reporting, cursor emission, NULL rendering, and default/max limits. This is unusually complete behavioral disclosure.

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?

Front-loads the core action and return format, then layers limits and safety behavior. It is dense but nearly every clause carries information; the single long paragraph is slightly harder to scan than a structured list would be.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description explains both return formats, NULL handling, truncation signaling, and the cursor field. For a 6-parameter query tool this is complete enough for an agent to call it correctly.

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 100%, so the baseline is 3, but the description adds real meaning: format=json stringifies integers beyond 2^53 to avoid rounding, and it explains the purpose of max_rows, max_bytes, and timeout_seconds with their ceilings. It goes beyond restating the schema.

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 and resource ('Runs one SQL statement on a connection') plus the return shape (aligned text table or JSON). It is clearly distinguishable from siblings like next_page and query_across_databases, and it explicitly hands off to next_page for cursors.

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 clear context: read_only vs read_write connection behavior, refusal of UPDATE/DELETE without WHERE, and use of the database's own SQL dialect. It also routes to next_page when results are truncated. It does not explicitly contrast with query_across_databases or explain, but the when-to-use context is strong.

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