Skip to main content
Glama

query

Run a read-only SQL SELECT or WITH query against your WhatsApp chat database and get matching rows as JSON. Aggregate or LIMIT results to search messages and media text safely.

Instructions

Run a read-only SQL statement against the WhatsApp workspace database and return rows as JSON. Writes are blocked at the connection level. Always aggregate or LIMIT; results are capped at 500 rows.

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

Input Schema

NameRequiredDescriptionDefault
sqlYesa single read-only SQL statement (SELECT / WITH); always aggregate or LIMIT
limitNomaximum rows to return, default 200, max 500

Output Schema

NameRequiredDescriptionDefault
rowsYes
columnsYes
truncatedNotrue when the row or byte cap cut the result short — narrow the query

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.24

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses that writes are blocked at the connection level, that results are capped at 500 rows, and that output is JSON. It omits error/timeout behavior and the SQL dialect, which keeps it short of a 5.

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?

Three short sentences, front-loaded with what the tool does and the safety guarantee. The aggregate/LIMIT advice is repeated in the parameter description, a minor redundancy, but nothing else is wasted.

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?

An output schema exists, so return values need not be explained, and the read-only plus row-cap behavior is covered. What remains missing for a SQL tool is a pointer to schema discovery (get_schema) and dialect/syntax expectations, a modest gap rather than a blocking one.

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 (sql and limit with its 200 default / 500 max) are already documented in the schema. The description only restates the aggregate-or-LIMIT advice and adds no new parameter meaning, so the baseline 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?

Names a specific verb (run) and resource (read-only SQL against the WhatsApp workspace database) plus the return shape (rows as JSON). It is clearly distinct from get_schema/search/send by virtue of being a raw SQL query tool, but it never explicitly contrasts itself with those siblings.

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

Usage Guidelines3/5

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

Gives an in-tool rule ('always aggregate or LIMIT') but no routing guidance: nothing says to call get_schema first to learn tables, or when to prefer search over ad hoc SQL. Usage is implied by the read-only SQL framing rather than stated.

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

Deploy Server

Other Tools