Skip to main content
Glama
MCP Project Context Server

MCP Project Context Server

db_query

Run SQL queries against a project’s PostgreSQL database, with automatic project detection when none is specified, to retrieve or modify project data.

Instructions

Executa uma query SQL no banco de dados PostgreSQL do projeto

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": {
      "query": "<query>"
    },
    "name": "db_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesQuery SQL a ser executada (SELECT, INSERT, UPDATE, etc)
projectNoNome do projeto (opcional, detecta automaticamente se não fornecido)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden, yet it reveals little beyond the engine type. It never states that the query can mutate or destroy data (the schema's mention of INSERT/UPDATE only appears in the parameter description), says nothing about permissions, transactional behavior, row limits, or what the result looks like, which is a serious omission for an arbitrary-SQL execution tool.

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?

The description is a single front-loaded sentence with no filler or redundancy. Its brevity is efficient but borders on under-specification rather than being deliberately tight, so it stops short of a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool that executes arbitrary SQL against a database with no annotations and no output schema, the description is far too thin. It omits safety posture, mutation risk, result format, and any hint about limits, leaving gaps an agent must guess at before invoking a potentially destructive operation.

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 both the required query parameter and the optional project parameter are already documented in the schema, including the accepted statement types and the auto-detection fallback. The description adds no additional meaning beyond this, so the baseline of 3 applies.

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 names a concrete verb (executes) and resource (SQL query on the project's PostgreSQL database), so the agent knows exactly what the tool does at a high level. It does not differentiate itself from sibling tools such as db_describe_table or db_list_tables, so the agent cannot infer from the description alone why it should prefer this general executor over the specialized helpers.

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

Usage Guidelines2/5

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

The description gives no guidance on when to use this tool versus alternatives, and names no siblings. With related tools like db_describe_table and db_list_tables present, an agent receives no signal about whether to use the raw query tool for exploration or reserve it for arbitrary SQL, and no prerequisites or exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.