Skip to main content
Glama

Query the sandbox database

query_sandbox
Read-onlyIdempotent

Execute read-only SQL SELECT queries against the sandbox database to verify queries, test aggregations, and inspect data without external terminals.

Instructions

Execute a read-only SQL query against the sandbox database.

Allows AI coding agents to verify SQL queries, test aggregations, or inspect data in the sandbox directly without opening external terminals.

Args: query: SQL SELECT query to execute. db_path: Optional path to the database (defaults to '.misata/sandbox.db'). limit: Max rows to return (default: 100).

Returns: Dict with columns, rows (as list of dicts), row_count, and execution status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
db_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.11

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint=false, and destructiveHint=false, and the description's 'read-only' claim is consistent with them. It adds value beyond annotations by disclosing the default database location and the default row cap, plus the fact that no external terminal is needed. It does not say what happens if a non-SELECT statement is submitted, which is the remaining behavioral gap.

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-loaded with the core action, then a rationale sentence, then clearly labeled Args and Returns sections. Every element is relevant, though the rationale sentence is slightly verbose and the Returns block partly duplicates the output 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?

For a three-param, read-only sandbox query tool with annotations and a declared output schema, the definition covers purpose, use cases, all parameters, defaults, and return shape — so an agent can call it correctly. The only omission is error/enforcement behavior for invalid or non-read-only SQL, which is a minor gap.

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 description coverage is 0%, so the description carries the full burden and largely does so: it defines query as the SQL SELECT to execute, db_path as an optional path defaulting to '.misata/sandbox.db', and limit as the max rows with a default of 100. This covers all three parameters with meaning and defaults, though it omits any syntax note such as whether multi-statement or mutating SQL is rejected.

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 first sentence states a specific verb and resource — 'Execute a read-only SQL query against the sandbox database' — plus the scope constraint (read-only, sandbox). This is immediately distinguishable from siblings like inspect_schema, seed_database, or create_sandbox.

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 gives concrete use cases ('verify SQL queries, test aggregations, or inspect data in the sandbox directly without opening external terminals'), which tells the agent when this tool is the right pick over running an external shell. It stops short of naming alternatives (e.g., inspect_schema for structure) or stating exclusions, so it is clear context without explicit routing.

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