Skip to main content
Glama

query_invoices_sql

Run read-only SQL SELECT queries on invoice and line-item tables to answer spending questions and analyze purchases; write operations are rejected.

Instructions

Run a read-only SQL SELECT against the invoice database (tables: invoices, line_items).

Read the invoices://schema resource first. Writes are rejected.

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_invoices_sql"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 burden and does disclose the key traits: the operation is read-only and any write statement is rejected. What it omits is operational behavior an agent would want for free-form SQL — row limits, timeouts, cost, and whether errors surface as exceptions — but the core safety profile is stated.

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?

Two short sentences, front-loaded with the action and scope, followed by the prerequisite. The final 'Writes are rejected' slightly restates the earlier 'read-only', a small 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 described, and the tool takes a single parameter. Given that, the description covers the essentials — statement type, target tables, prerequisite resource — with only execution limits and error semantics left unstated.

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 0% and the single parameter is just a bare 'sql' string, so the description must compensate. It does so usefully by scoping the query to available tables (invoices, line_items), restricting the statement type to SELECT, and directing the agent to invoices://schema for column-level detail.

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?

States a specific verb and mechanism ('Run a read-only SQL SELECT') against a named resource ('the invoice database') and even enumerates the tables (invoices, line_items). It is clearly distinguishable from list_invoices or spending_report by being free-form SQL, 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?

Provides one concrete prerequisite ('Read the invoices://schema resource first') and one hard constraint ('Writes are rejected'), which tells the agent when the tool will fail. However, there is no guidance on when to prefer this over the sibling convenience tools (list_invoices, get_invoice, spending_report), leaving that choice to inference.

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