Skip to main content
Glama

Beancount.io

Run BQL with Typed Results

runBqlQueryStructured
Read-onlyIdempotent

Execute BQL and return the typed table (column names, types, and rows) or structured text result. Uses the same query contract as REST JSON and GraphQL queryShell. The query travels in a POST body end to end, so long queries have no URL-length ceiling.

Input Schema

NameRequiredDescriptionDefault
queryYesThe BQL query to execute
ledgerNoTarget ledger as owner/name. Required for an unpinned credential; defaults to the credential's ledger restriction.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNo
resultNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/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 closed-world, and the description complements that with genuinely non-obvious context: the query travels in a POST body, so there's no URL-length limit, and the query contract matches REST JSON and GraphQL queryShell. That is real added value beyond the annotations.

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?

Three short sentences, each earning its place: what it returns, the shared query contract, and the POST/URL-length property. Front-loaded with the outcome and free of filler.

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?

With annotations covering safety, an output schema covering return types, and full schema descriptions, the description only needs to add transport/protocol context, which it does. The missing piece is routing guidance versus the runBqlQuery sibling.

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%, including the ledger default/credential-restriction note, so the schema already carries parameter meaning. The description adds no parameter-level detail beyond it, 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?

States a specific verb and resource (Execute BQL) and describes the output shape precisely: a typed table with column names, types, and rows, or a structured text result. It does not explicitly distinguish itself from the sibling runBqlQuery, which an agent would need to know to pick correctly.

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?

Usage is only implied by the phrase 'typed results' – one can infer this is the choice when structured/typed output matters. There is no explicit when-to-use, when-not, or comparison against runBqlQuery or any other sibling.

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.