Skip to main content
Glama

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. Dates show when Glama detected each change.

  1. Added

TDQS

A4.7/5.0
Behavior5/5

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

The description discloses important behavior beyond annotations: only one statement is allowed, a second is refused, schema-changing statements are refused, and return shapes differ for selects versus writes. This is substantial operational context that the annotations alone do not provide. No contradiction with the annotations is present.

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 three dense sentences with no filler. It front-loads the core purpose, then states exclusions, permissions, and output behavior. Every sentence contributes to correct invocation.

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?

Despite having no output schema, the description explains what the tool returns for both select and write statements. It also covers the key constraints: one statement, no schema changes, and ownership requirements. For a tool of this complexity, nothing essential is missing.

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%, and the schema already documents app_id, sql, and params, including placeholder usage and the single-statement rule. The description adds useful return-shape context but not much per-parameter meaning beyond what the schema supplies. The baseline of 3 is appropriate here.

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 description states a specific action: run one SQL statement against the app's own database, for reading rows or fixing data. It also explicitly excludes schema changes and routes those to migrations, which distinguishes it clearly from any file or migration-related siblings.

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

Usage Guidelines5/5

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

It gives clear when-to-use guidance: read or fix data via SQL. It gives an explicit when-not-to-use and alternative: schema changes belong in a version's migrations file and are refused. It also states the permission boundary: owners and editors only.

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.

TDQS

A3.8/5.0
Disambiguation4/5

Most tools target clearly distinct actions and resources, such as app CRUD, versioning, sharing, secrets, and folder operations. A few adjacent tools like read_app, read_app_file, and read_app_version, or update_app and publish_app_version, require careful reading, but their descriptions are explicit enough to prevent serious confusion.

Naming Consistency3/5

The set mostly uses a verb_noun pattern, with names like create_app, list_secrets, set_app_access, and trash_app. However, Unix-style commands like ls, mkdir, mv, tree, and whoami, plus mixed verbs such as get, read, list, remove, and revoke, break any single consistent convention.

Tool Count3/5

24 tools is on the heavy end of the 16-25 range, and while the platform covers apps, versions, folders, sharing, secrets, logs, and databases, the count feels somewhat large. Each tool has a defined role, but several could potentially be consolidated without losing clarity.

Completeness4/5

The surface covers the main lifecycle well: creating, reading, updating, versioning, sharing, securing, and organizing apps, plus secrets and database queries. Notable gaps are the lack of a permanent delete or restore tool for trashed apps, and the stated absence of captured function logs, but these are workable limitations rather than dead ends.