Skip to main content
Glama

Airlok

Запрос к базе

query_database
Read-only

SQL-запрос только на чтение к Postgres приложения — на хостинге и на своём сервере: один оператор (SELECT, WITH, EXPLAIN), транзакция только на чтение, таймаут 5 с, до 100 строк и 256 КБ ответа, ячейки до 300 символов. Изменить данные так нельзя. Список таблиц: SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema NOT IN ('pg_catalog', 'information_schema'). На своём сервере запрос выполняет агент; агент старой версии во время публикации отвечает только после неё. Если у приложения на хостинге есть Data API, запрос доступен только токену с правом публикации и пишется в журнал.

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": {
      "app": "<app>",
      "sql": "<sql>"
    },
    "name": "query_database"
  }
}

Input Schema

NameRequiredDescriptionDefault
appYesid приложения, его имя или «сервер/имя»
sqlYesодин оператор SQL, например SELECT * FROM orders ORDER BY created_at DESC LIMIT 20

Schema Changelog

Changes observed during successful MCP inspections.

No schema history has been recorded yet.

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, it discloses concrete operational limits (5 s timeout, 100 rows, 256 KB response, 300-character cells), the read-only transaction envelope, the self-hosted agent behavior during publishing, and that Data API queries require publish rights and are logged. These are exactly the facts an agent needs before invoking it.

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?

Constraints are front-loaded in the first sentence, followed by the useful table-listing query and then the environment caveats. It is dense but nearly every clause carries operational meaning; the self-hosted agent publishing note is the one clause an agent is least likely to need on every call.

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 two-parameter read-only query tool with no output schema, the definition covers limits, safety, permissions, and discovery of tables. The only gap is that it does not describe the shape of the result rows/columns, though the inlined limits make responses predictable in size.

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 coverage is 100%, so both parameters are already documented. The description adds constraint semantics for `sql` (single statement, allowed statement kinds, row/size ceilings) but nothing further about the `app` identifier format beyond what the schema states.

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 clause names a specific verb and resource — a read-only SQL query against the app's Postgres — and immediately scopes it to both hosting and self-hosted servers. This clearly separates it from siblings such as get_database (connection data) or set_database_access (permissions).

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 hard preconditions (a single statement of type SELECT/WITH/EXPLAIN, read-only transaction) and explains that data cannot be modified this way, which implicitly routes writes elsewhere. It also supplies a ready-made information_schema query for discovering tables and notes the Data API token requirement, though it never names a concrete alternative tool for writing or schema inspection.

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