Skip to main content
Glama

ohmyho.st

Run one bounded read-only Dev or Prod database query

database_query
Read-onlyIdempotent

Read one owner-authorized Dev or Prod database query (at most 100 rows, five-second timeout). Explicitly choose the environment. Shared data resolves to the same physical database. Application RLS policies apply; use an authorized SQL export when a full archive is required. The statement starts with SELECT or WITH in any letter case, has no trailing semicolon and is at most 4,096 bytes, with at most 32 scalar parameters; a result over 256 KiB fails and any SQL error returns one generic 400. If the selected environment has no database, follow database_not_set_up.

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": {
      "project_id": "<project_id>",
      "environment": "<environment>",
      "statement": "<statement>",
      "parameters": "<parameters>"
    },
    "name": "database_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
statementYesOne SELECT or WITH statement in any letter case, at most 4,096 bytes, without a trailing semicolon, because it runs as a subquery.
parametersYes
project_idYesProject identifier.
environmentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, but the description adds substantive behavior the annotations cannot convey: row cap, five-second timeout, 4,096-byte statement limit, 32 parameter cap, 256 KiB result ceiling, generic 400 on any SQL error, and RLS policy enforcement. It also explains that shared data resolves to the same physical database, which is non-obvious operational context.

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?

Five sentences, each carrying a distinct constraint or routing rule, front-loaded with the core action and caps. It is dense rather than padded, but the middle sentence strings several unrelated limits together, making it slightly harder to scan than a bulleted constraint list would be.

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?

With no output schema, the description still covers the return envelope indirectly (row cap, result size ceiling, generic 400 on failure) and tells the agent how to proceed when no database exists. The remaining gap is the shape of a successful response (columns/rows structure), which an agent must discover by calling it.

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 50%, and the description compensates well for the weaker half: it explains why the statement must have no trailing semicolon ('because it runs as a subquery') and restates the case-insensitive SELECT/WITH and 32-parameter constraints. The environment choice is given explicit significance ('Explicitly choose'), though project_id and how parameters bind to placeholders remain unaddressed in both schema and description.

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 ('Read one owner-authorized Dev or Prod database query') and bounds the scope ('at most 100 rows, five-second timeout'), so the agent knows exactly what operation this is. It never names the write counterpart (database_write) explicitly, relying on 'read-only' and the tool name to separate them, which is clear but not maximally differentiating.

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?

'Explicitly choose the environment' gives a direct prerequisite for invocation, and 'use an authorized SQL export when a full archive is required' names an alternative for a specific condition, plus a routing instruction to database_not_set_up. What's missing is guidance on when to prefer database_write or a scheduled run instead, so the alternative surface is only partially covered.

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.