Skip to main content
Glama

Query database

db_query
Read-only

Query a collection of the artifact's shared database (any role can read). where is [[field, op, value]] with op one of ==, !=, <, <=, >, >=, in, array-contains (a missing field matches no op); orderBy is [[field, "asc"|"desc"]]; limit is 1-500. Returns { docs: [{ id, data }] }.

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

Input Schema

NameRequiredDescriptionDefault
idYes
pathYes
limitNo
whereNo
orderByNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior4/5

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

The annotations already establish readOnlyHint=true and destructiveHint=false, and the description adds meaningful context beyond that: access is allowed for any role, where operators are enumerated with missing-field behavior, limits are constrained to 1-500, and the return shape is shown. It does not cover defaults for omitted orderBy/where or broader operational limits.

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 dense but front-loaded and every clause adds operational value: access scope, filter syntax, ordering syntax, limit bounds, and return shape. There is no filler.

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

Completeness3/5

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

It compensates for the missing output schema by stating the return shape and gives strong query-syntax semantics. However, with 5 parameters at 0% schema coverage, the required id and path parameters remain unexplained, so the definition is not fully complete for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry parameter meaning. It explains where, orderBy, and limit in useful detail, but leaves the two required parameters id and path completely undocumented, which is a significant gap for invocation correctness.

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: querying a collection in the artifact's shared database. It clearly describes a read/query operation, but it does not explicitly distinguish this from sibling tools such as db_get, db_set, or changes_since.

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?

It notes that any role can read, which implies safe read usage, but gives no explicit guidance on when to use db_query versus db_get, db_set, db_delete, or changes_since. Alternatives and exclusions are absent.

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