Skip to main content
Glama

Run one SQL statement

query_app_db

Run one SQL statement against a function app's own database, to read rows and to fix data. Not for schema: a table or a column belongs in the version's migrations/NNNN_name.sql, and a statement that changes the schema is refused. Owners and editors only. Answers rows and rowCount for a select, and changes with lastInsertRowid for a write.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesOne statement, with ? placeholders for every value that comes from somewhere else. A second statement in the same string is refused.
app_idYesThe app id, as returned by search_apps or create_app. Starts with app_.
paramsNoThe values for the ? placeholders, in order. Strings, numbers, booleans and null.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations carry almost no signal (three false hints), and there is no output schema, so the description does the full disclosure burden: it reveals that schema-changing statements are enforced/refused, that only owners and editors may invoke it, and exactly what comes back ('rows and rowCount for a select', 'changes with lastInsertRowid for a write'). This return-format disclosure is essential and well handled. Nothing contradicts the annotations.

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?

Four sentences, each carrying distinct value: purpose, schema exclusion, permission, and return shape. The core purpose and scope are front-loaded in the first sentence, and there is no redundant or filler wording — every sentence earns its place.

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?

For a 3-parameter tool with no output schema, everything needed for correct invocation is present: which app and SQL to pass (via schema), what the tool does, what it refuses, who may run it, and what it returns for both read and write statements. Error-case behavior is not described but is not required for correct selection and invocation.

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 sql, app_id, and params including the single-statement rule. The description reinforces the one-statement constraint and the select-vs-write distinction, but adds no per-parameter meaning beyond the schema, so baseline 3 applies.

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?

Opens with a specific verb+resource+goal: 'Run one SQL statement against a function app's own database, to read rows and to fix data.' The scope is pinned down by 'one statement' and the refusal of schema changes, and no sibling tool handles SQL against the app DB, so an agent can distinguish it without opening any other schema.

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 states when to use the tool (read rows, fix data) and gives an explicit when-not: 'a table or a column belongs in the version's migrations/NNNN_name.sql, and a statement that changes the schema is refused.' It routes schema work to the migration workflow rather than to any sibling tool by name, and adds an owner/editor prerequisite. Naming a direct sibling alternative would have made it a 5.

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.