Skip to main content
Glama
spacetimedb-mcp

spacetimedb-mcp

sql_query

Run SQL queries against a SpacetimeDB database to inspect or modify data, with optional JSON or markdown output.

Instructions

Run a SQL query against the database to inspect or modify data.

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": {
      "database": "<database>",
      "query": "<query>"
    },
    "name": "sql_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesThe SQL query (e.g., SELECT * FROM users LIMIT 10)
formatNoOptional output format: json (default) or markdown
databaseYesThe database name. Required if no default is set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.1

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It mentions that the tool can modify data, but does not disclose destructive or irreversible effects, required permissions, transaction behavior, or whether the query is executed immediately.

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?

The description is a single front-loaded sentence with no unnecessary wording. It is appropriately sized and easy to parse.

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

Completeness2/5

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

For a high-risk SQL execution tool with no annotations and no output schema, the description is too thin. It omits critical context about safety, execution semantics, result handling, and when to prefer schema-discovery alternatives.

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 description coverage is 100%, so the schema already documents query, database, and format parameters. The description adds no parameter-level meaning beyond what the schema provides, which meets the baseline of 3 under high coverage.

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 states a specific verb and resource: running a SQL query against a database. It clearly conveys the tool's core purpose, though it does not differentiate from siblings such as get_schema or describe_database.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit guidance on when to use this tool versus schema-inspection siblings, nor any when-not-to-use or read-only versus write guidance. The phrase 'inspect or modify data' implies general usage but provides no routing or safety context.

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