Skip to main content
Glama

Turn Zero Cloud for Backend & Hosting

Query app database

tzcloud_query_database
Read-onlyIdempotent

Run one read-only SQL statement against your application's database and read a bounded page of its rows. The statement starts with SELECT, WITH, VALUES, or TABLE. It runs in a read-only transaction that is always rolled back, with a 10-second timeout. Rows are PostgreSQL's text or null, bounded by limit and 64 KiB. truncated (rows or bytes) means more rows remained: narrow with WHERE, LIMIT or fewer columns, or, for rows, raise limit up to 1,000. A write is refused query_not_read_only. Any other failure of the statement or its session is refused query_failed. Without environment, the call reads production.

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": {
      "application": "<application>",
      "sql": "<sql>"
    },
    "name": "tzcloud_query_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYesOne SQL statement starting with SELECT, WITH, VALUES, or TABLE, at most 10,000 characters, with no bound parameters. A write is refused `query_not_read_only`; a second statement or a SELECT INTO is refused `query_failed`.
limitNoHow many rows at most, 1 to 1000; 100 where none is given. The answer also stops at 64 KiB of row data, and `truncated` says which bound cut it.
applicationYesYour account's application `id` from `tzcloud_list_applications`, not its name or label.
environmentNoProduction where absent, after its first promote (two environments) or production deploy (one); `development` reads development or a one-environment local run's database; another value draws `invalid_request`, a database not yet made draws `not_found`.

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the annotations (readOnlyHint, idempotentHint, destructiveHint=false) by disclosing a rolled-back read-only transaction, a 10-second timeout, a 64 KiB response cap, the `truncated` values and their meaning, and the exact refusal codes `query_not_read_only` and `query_failed`. The production-default behavior is precisely the kind of side effect an agent must know before calling.

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 result shape, then layers constraints, truncation guidance, and error codes in a compact order with no wasted sentences. The backtick-heavy final clauses are dense, but every clause carries behavioral information rather than filler.

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?

There is no output schema, so the description carries the return-value burden itself and does so: rows as PostgreSQL text or null, the two bounding mechanisms, and the `truncated` indicator. Error codes, timeout, rollback semantics, and environment defaulting are all covered for a tool with this much implicit behavior.

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: the interaction between `limit` and the 64 KiB byte bound, and the consequences of omitting `environment` (production by default). It stops short of restating what each parameter accepts at the level of detail the schema already gives, which is appropriate.

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 ("Run one read-only SQL statement against your application's database") plus the scope of the result ("a bounded page of its rows"). The statement-type restriction (SELECT, WITH, VALUES, TABLE) makes it unambiguous versus siblings such as tzcloud_clear_development_database or tzcloud_list_applications.

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 operational guidance: how to narrow results when `truncated` is `rows` (raise `limit` up to 1,000, add WHERE/LIMIT/fewer columns) and that omitting `environment` reads production. It does not name an alternative sibling for e.g. mutating the database, but the read-only framing plus the explicit production default makes the usage context clear.

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.

Resources