Skip to main content
Glama

Read-only SQL query

saga_query
Read-onlyIdempotent

Run read-only SELECT queries against SAGA C accounting data to retrieve trial balances, ledgers, open invoices, VAT, and stock.

Instructions

Runs one SELECT (Firebird 3 SQL dialect) inside a READ ONLY transaction. Use FIRST/ROWS for limits, ? for parameters. Text columns are padded with spaces; compare with = (trailing blanks ignored) or TRIM(). Payroll tables are blocked unless the server owner enabled them.

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": "saga_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
sqlYes
firmNoFirm code (folder name such as "0001"). Optional when only one firm is configured.
paramsNo
max_rowsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description goes further by disclosing the single-statement limit, the READ ONLY transaction boundary, space-padded text columns with the = vs TRIM() workaround, and a payroll-table blocklist gated on server-owner configuration. It stops short of stating whether max_rows truncates silently or how errors surface, which keeps it off 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?

Four tight sentences, front-loaded with the operation and transaction mode before dialect pitfalls and the blocklist caveat. Every clause carries information; only the padding/TRIM tip is arguably routine boilerplate.

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?

Covers dialect, parameterization, row-limiting syntax, string-comparison quirks, and access restrictions, which is strong for a 4-parameter tool with no output schema. Remaining gap is return-shape behavior — whether results are truncated at max_rows and in what form rows come back.

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 only 25% (only firm is documented in the schema), so the description carries real weight — it explains that the SQL is parameterized and bound positionally via ?, which is the key semantic for the params array. It adds nothing about max_rows or the sql parameter's single-statement constraint beyond the first sentence.

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?

States a specific verb and resource ("Runs one SELECT"), pins the dialect (Firebird 3), and confines execution to a READ ONLY transaction. An agent immediately knows this is a raw read-only SQL escape hatch, distinct in kind from the domain-specific saga_* report tools.

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 in-dialect usage hints (FIRST/ROWS for limits, ? for parameters) but never says when to reach for this instead of a purpose-built sibling like saga_trial_balance or saga_list_tables, nor when it should be avoided. Usage is implied rather than routed.

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