Skip to main content
Glama

Generate readiness checks

generate_checks
Read-onlyIdempotent

Generate SQL readiness checks for mapped revenue datasets, run them, and pass the result rows back to get pass/fail per check and metric; then use plan_fixes for ranked fixes.

Instructions

The readiness checks the GASP Standard states, as SQL over the datasets your mapping covers (readiness level 3, the Check step). From cel.md, atl.md and the MRR definition: CEL row identity (prior_mrr + mrr_change = new_mrr on every revenue event), MRR continuity (a subscription's mrr_start equals its mrr on the previous snapshot), the year-or-renewal test (no subscription row and no contract ACV for a contract under 12 months with no renewal), unique event_id per event dataset, the ATL tags (one lifecycle_attribution per event, an expansion_classification on every expansion, contraction and reactivation revenue event and every amendment, a cost_function on every cost event), customer identity both ways (every revenue event's customer is a known customer, every customer active on the latest snapshot has a revenue event), the credit ledger's balance identity (credit_balance_before + credit_amount = credit_balance_after on purchase, expiry, adjustment and committed consumption rows; equal balances on overage and on-demand rows), freshness (the latest date per dataset within a window) and, for every fully mapped metric with a hard range rule in the ontology (NRR at least 0, GRR at most 100%, Gross Margin, ARR and others), its value in every reporting period of your period spine (the table compile_model reads; period_spine names another). One statement, one row per check with its violation count; output: bundle adds a schema snapshot query for a scheduled re-check. GASP has no warehouse access: run it, then pass the rows back as results to get pass or fail per check and per metric; each check names the metrics whose formulas read what it covers. Checks whose fields the mapping lacks are listed with what they need. Takes the mapping generate_query takes; the dialect is the one asked for, else the warehouse's, else postgres. Follow with plan_fixes for the ranked list.

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": {
      "adapter": "<adapter>"
    },
    "name": "generate_checks"
  }
}

Input Schema

NameRequiredDescriptionDefault
as_ofNoThe date freshness is measured from, as YYYY-MM-DD. Default: the warehouse's current date.
outputNo'report' (default): the checks, what each protects and the SQL to run (or, with results, pass and fail per check and per metric); 'sql': the statement alone; 'json': the report as data; 'bundle': the scheduled re-check, the checks statement and a schema snapshot query over the mapped tables as two files to run in your own orchestrator, with how to pass the rows back to readiness_report.
windowNoFreshness window in days (default 2): the latest date in each dataset must be within this many days of as_of.
adapterYesYour mapping as text: a GASP adapter (JSON; schema: https://gaspwiki.com/schemas/gasp-adapter-v1.json) or an Ossie mapping document (YAML or JSON). Check it with validate_mapping first.
dialectNoSQL dialect: postgres (also Redshift), snowflake, bigquery or databricks. Omit to use the adapter's warehouse when it names one of them, else postgres.
resultsNoThe rows the checks statement returned, as JSON (objects with check_id and violations, [check_id, violations] pairs, or an object keyed by check id) or CSV. With results the report gives pass or fail per check and per metric.
period_spineNoThe table of (period_start, period_end) rows the range checks evaluate each metric over, as it is named in your warehouse; the same table compile_model reads. Default gasp.period_spine.
semantic_modelNoWith an Ossie mapping: your semantic model document (YAML or JSON), so table names and field expressions resolve. Ignored for a GASP adapter.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Beyond the readOnly/idempotent annotations, it discloses the key operational fact that GASP has no warehouse access, so the statement must be executed externally and the rows fed back via results to obtain pass/fail. It also covers the dialect resolution order (asked-for, else warehouse's, else postgres), the one-row-per-check violation-count shape, and the bundle's schema-snapshot output. That is substantial context the annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The purpose is front-loaded, but the body is a single dense run-on held together by semicolons and parenthetical lists of every check type, which is hard to scan. The check enumeration arguably earns its place as specification, but the delivery is cramped rather than structured.

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 an 8-parameter tool with no output schema, the description fully accounts for the return surface by spelling out each output mode (report, sql, json, bundle) and the results-driven pass/fail path. Edge cases such as missing mapping fields and dialect fallback are also covered, so nothing an agent needs to call it correctly is missing.

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 cross-tool meaning: period_spine is 'the table compile_model reads', adapter is 'the mapping generate_query takes', and results accepts the returned rows in several shapes. These cross-references help an agent choose values in a way the schema text alone does not.

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?

The opening sentence names the specific resource (the readiness checks the GASP Standard states) and its form (SQL over the datasets the mapping covers), and later sentences distinguish it from generate_query (same mapping input), compile_model (period_spine), plan_fixes (follow-up ranking) and readiness_report (results pass/fail). The generating verb itself is only implied by the title, but an agent can still tell what this produces versus its siblings.

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

Usage Guidelines4/5

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

Explicit sequencing is given: 'Check it with validate_mapping first', 'run it, then pass the rows back as results', and 'Follow with plan_fixes for the ranked list'. It also states what to do when the mapping is incomplete (checks listed with what they need). No explicit exclusion of a case where you should not call it, which keeps it short of a 5.

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