Skip to main content
Glama

Write values with AQL

aql_write
Destructive

Write a 2D region of values into an Azquo database using the same AQL grammar as query_aql. AQL reference: https://www.azquo.com/connect/#aql

Mirrors the read shape — rowHeadings × columnHeadings × context — and adds a 2D values array. The cell at values[r][c] is anchored to the union of rowHeadings[r] + columnHeadings[c] + context, exactly as a read at the same coordinates would resolve.

Two modes, distinguished by options.createNames:

Case 1 — TRANSACTIONAL find-or-create. Caller supplies options.rowSet + options.rowLanguage (and/or columnSet + columnLanguage) + createNames: true. Unresolved row/column headings are FIND-OR-CREATED under the target set with the language attribute set. Arrow form: rowSet = "A->B" puts new names into B as a child of A (chain is auto-created if missing). Use for: importing new transactions, customers, or any entity whose ID column is the row heading.

Case 2 — MULTI-FACETED all-or-nothing (default; createNames: false). Every heading must resolve to an existing name. Any miss is fatal — no values land. Use for: writing into a pre-structured region where the names are already known.

Structure-only mode: omit values (or pass []). The call resolves the headings, find-or-creates names if createNames=true, but writes no values. Equivalent to declaring hierarchy. columnHeadings still needs at least one heading.

For date columns where the duplicate-name trap applies, use options.rowLanguage = "date" (bare attribute name, no "language" prefix). rowLanguage / columnLanguage always take the literal attribute name verbatim.

createNames and ignoreHeadingErrors are mutually exclusive — supply at most one.

═══ PROVENANCE — required on every write ═══ source: origin reference (file/URL/document). Lands on Provenance.name in the audit trail. agent: your AI agent name (e.g. "Claude"). Lands on Provenance.method.

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": {
      "database": "<database>",
      "rowHeadings": "<rowHeadings>",
      "columnHeadings": "<columnHeadings>",
      "context": "<context>",
      "source": "<source>",
      "agent": "<agent>"
    },
    "name": "aql_write"
  }
}

Input Schema

NameRequiredDescriptionDefault
agentYesAI agent name (e.g. "Claude"). REQUIRED.
sourceYesOrigin reference — file, URL, document, or short note. REQUIRED.
valuesNo2D array of cell values (string | number | boolean | null). Omit or [] for structure-only mode.
contextYesContext expressions as a 2D array — use [[]] if no context needed
optionsNoEngine options — see query_aql for the full shape. Adds rowSet/columnSet/createNames for AQL-write.
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 write into
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. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructive=true and idempotent=false, but the description adds the consequential detail: in default mode any unresolved heading is fatal and 'no values land,' while createNames=true silently creates hierarchy. It also discloses the audit-trail side effect of source/agent landing on Provenance.name/method, which is not visible from the schema.

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?

Front-loaded with the core contract and cleanly sectioned with headers and case labels, so it scans well despite length. There is minor redundancy — the verbatim-attribute rule is stated twice and 'REQUIRED' echoes the schema — but each block carries operational content.

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?

For a 9-parameter destructive nested-object mutation with no output schema, the description covers modes, failure semantics, structure-only behavior, provenance obligations, and cross-business scoping. Nothing an agent needs to call it safely is missing, and lack of a return-shape description is acceptable given no output schema is declared.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Though schema coverage is 100%, the description adds semantics the schema cannot: the arrow form 'A->B' for rowSet, that rowLanguage/columnLanguage take the literal attribute name verbatim, the 'date' special case, and how the values grid anchors against rowHeadings + columnHeadings + context. These are genuine interpretive rules for nested options, well beyond baseline.

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 — writing a 2D region of values into an Azquo database — and ties it to a named sibling's grammar (query_aql), so the read/write split is immediately legible. The 'values[r][c]' anchoring explanation makes the write semantics concrete rather than generic.

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?

Explicitly enumerates two modes (transactional find-or-create vs. all-or-nothing default), names the switching flag (options.createNames), and gives a 'Use for:' sentence for each. It also flags the mutual exclusion with ignoreHeadingErrors and the structure-only variant, leaving little to inference.

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