Skip to main content
Glama

Query with AQL

query_aql
Read-only

Query an Azquo database using AQL (Azquo Query Language). AQL reference: https://www.azquo.com/connect/#aql

Read-only - this never creates or changes names or values; a heading with an edit: command or an "as" set assignment is refused (use aql_write for those). The main way to get numbers out of a database for an ad-hoc question. Neighbours: aql_write saves values with the same heading model; get_report_data runs an existing report; describe_set / describe_query explore names and sets rather than values; audit_cell explains where one cell of this tool's result came from.

AQL works with row headings, column headings, and context — all as nested string arrays, laid out like the heading area of a spreadsheet: each inner array is one row of heading cells, each string one heading. In a stack of headings, a heading on an earlier line applies until another heading or a "." replaces it, so it need not be repeated; the LAST line (the right-hand column, for row headings) is where data anchors and must be filled in every position that should have data.

Example — get monthly sales figures by product: rowHeadings: [["Products children"]] columnHeadings: [["Sales"], ["Jan", "Feb", "Mar"]] context: [["2024"]]

The response contains: rowHeadings — resolved row labels columnHeadings — resolved column labels context — resolved context rows — 2D array of cell values (one entry per [row][col]; raw types: string|number|boolean|null) rowCount, columnCount, truncated — pagination info (options.rowLimit, default 1000)

Raise options.rowLimit (0 = no limit) when truncated is true. A heading naming something that is not in the database fails with aql_syntax and the engine's message - find the right name with list_names - unless options.ignoreHeadingErrors is true. Other failures return aql_runtime.

Input Schema

NameRequiredDescriptionDefault
contextYesContext expressions as a 2D array — use [[]] if no context needed
optionsNoEngine options, all optional - omit for defaults. rowLimit (default 1000, 0 = none), columnLimit; sortRow / sortColumn (a heading to sort by) with sortRowAsc / sortColumnAsc; hideRows / hideCols (1 drops blank rows/columns); rowLanguage / columnLanguage (attribute used to match heading text, e.g. "language date"); ignoreHeadingErrors (blank instead of an error for unknown headings); valueFormat "raw" (default) or "formatted". Example: {"rowLimit": 50, "sortColumn": "Sales", "sortColumnAsc": false}
businessNoOptional. The business this call is for, by name, e.g. "azquo" - it then runs there whatever business the session is in. Worth giving on writes when you work in more than one business: a new MCP session starts in the login's own business. list_businesses shows the names.
databaseYesDatabase name to query
rowHeadingsYesRow heading expressions as a 2D array of strings
columnHeadingsYesColumn heading expressions as a 2D array of strings

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / business
      Added value: +{
      +  "description": "Optional. The business this call is for, by name, e.g. \"azquo\" - it then runs there whatever business the session is in. Worth giving on writes when you work in more than one business: a new MCP session starts in the login's own business. list_businesses shows the names.",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / options / description
      Previous value: -"Engine options (rowLimit, columnLimit, sortRow/sortColumn, rowLanguage/columnLanguage, ignoreHeadingErrors, valueFormat, etc.). Omit for defaults."New value: +"Engine options, all optional - omit for defaults. rowLimit (default 1000, 0 = none), columnLimit; sortRow / sortColumn (a heading to sort by) with sortRowAsc / sortColumnAsc; hideRows / hideCols (1 drops blank rows/columns); rowLanguage / columnLanguage (attribute used to match heading text, e.g. \"language date\"); ignoreHeadingErrors (blank instead of an error for unknown headings); valueFormat \"raw\" (default) or \"formatted\". Example: {\"rowLimit\": 50, \"sortColumn\": \"Sales\", \"sortColumnAsc\": false}"
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond readOnlyHint=true and openWorldHint=false, the description discloses that write-like headings are refused, that unknown headings fail with aql_syntax unless ignoreHeadingErrors is set, that other failures return aql_runtime, and that rowLimit defaults to 1000 with truncation behavior. It also documents the response shape and pagination, which are not in 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but front-loads the core purpose, constraints, and alternatives before moving into heading mechanics, an example, response format, and error behavior. Most sentences carry useful invocation or interpretation guidance, though the density could be trimmed slightly without losing information.

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

Completeness5/5

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

With no output schema and a complex, nested input model, the description compensates by explaining the response fields (rowHeadings, columnHeadings, context, rows, rowCount, columnCount, truncated) and pagination controls. Error behavior and sibling alternatives are also covered, making it complete enough to call the tool correctly.

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 100%, so the baseline is 3, but the description adds substantial meaning about heading semantics: nested string arrays, earlier-line inheritance, and the requirement that the last row/column line be filled for data anchoring. It also clarifies options such as rowLimit behavior and ignoreHeadingErrors, though the schema already documents most option fields.

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?

The description states a specific verb and resource: "Query an Azquo database using AQL (Azquo Query Language)." It also differentiates from key siblings by naming aql_write, get_report_data, describe_set, describe_query, and audit_cell, so an agent can route correctly without opening every schema.

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

Usage Guidelines5/5

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

It explicitly states when to use this tool (ad-hoc numbers from a database) and when not to (edit: commands or "as" assignments are refused; use aql_write instead). It also names adjacent alternatives for reporting, exploration, and lineage, making the intended context clear.

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