Skip to main content
Glama

Compile GASP metrics into an Ossie model

compile_model
Read-onlyIdempotent

Compiles the GASP Standard metrics your mapping covers into your Ossie semantic model, adding a gasp_ metric per fully mapped formula and listing any entries still missing field pairs.

Instructions

Compile the GASP Standard metrics your mapping covers into your Apache Ossie semantic model. Takes the same input as validate_mapping (a GASP adapter, or an Ossie mapping with your semantic_model) and returns your model with a gasp_ metric for every formula entry whose fields are all mapped (main formula, O and M forms, variants and named breakdowns): a direct OSSIE_SQL_2026 expression over your datasets and fields where the expression language can state it, else staged through a dataset whose source is the compiled SQL over your tables in your warehouse dialect (a gasp_staged_ dataset with one row per period, or for Net and Gross Revenue Retention the table gasp_account_cohorts, one row per customer per period, which their expressions sum), reading a period spine table you provide (one row per reporting period; gasp.period_spine unless you pass period_spine). Entries with unmapped pairs are left out and listed with the pairs they need; recompiling replaces every gasp_ metric and staged dataset and leaves the rest of the model as it was. The compiled metrics are checked against the bundled Ossie model schema and GASP's reference checks. A GASP adapter compiles into the model synthesised from its tables and columns, which validate_mapping shows. Pass metrics or department to compile a subset, output 'report' to get the coverage without the document.

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

Input Schema

NameRequiredDescriptionDefault
outputNo'model' (default) returns the coverage report with the compiled model as YAML; 'report' returns the coverage alone.
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 of the staged sources: postgres (also Redshift), snowflake, bigquery or databricks. Omit to use the adapter's warehouse when it names one of them, else postgres.
metricsNoComma-separated metric names, abbreviations, aliases or formula ids to compile (each resolved as in lookup_metric), with their forms, variants and breakdowns. Omit for every metric.
departmentNoCompile every metric of one department (e.g. 'Core'); combines with metrics.
period_spineNoThe table of (period_start, period_end) rows the staged sources read, as it is named in your warehouse. Default gasp.period_spine.
semantic_modelNoWith an Ossie mapping: your semantic model document (YAML or JSON). The metrics compile into it, reading its sources and field expressions. Without it, dataset names stand for tables and every field is its bare column.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive, so the bar is lower, yet the description still adds substantial behaviour: recompiling replaces every gasp_ metric and staged dataset while leaving the rest of the model untouched, unmapped entries are omitted and listed with the missing pairs, and output is validated against the bundled Ossie schema and GASP reference checks. It does not mention cost/latency or failure modes when a pair is partially mapped beyond omission.

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 lead sentence is front-loaded and unambiguous, but the body is one sprawling sentence-spanning block with deeply nested parentheses (staged datasets, Net/Gross Revenue Retention, period-spine defaults) that must be re-parsed. The content is nearly all substantive, but structure is weak and a bulleted breakdown of model-vs-report outputs would read far better.

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, the description still fully covers the return shape: the model YAML plus coverage report, the report-only variant, and the per-entry listing of unmapped pairs. For a seven-parameter compilation tool with side effects on the returned document, nothing an agent needs in order 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; the description earns above that by explaining cross-parameter interaction the schema cannot state: an adapter alone synthesises a model from its tables and columns, while semantic_model supplies sources and field expressions, and dialect falls back to the adapter's warehouse. Defaults such as gasp.period_spine are restated rather than newly explained.

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 pair: compile GASP Standard metrics into an Apache Ossie semantic model, and defines the input contract as 'same input as validate_mapping'. It names what is produced (a gasp_ metric per fully-mapped formula entry, plus gasp_staged_ datasets) and what is deliberately not produced (entries with unmapped pairs), so an agent can distinguish this from validate_mapping, get_formula, or coverage_gap without opening a schema.

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?

Gives clear operating context: use validate_mapping on the input first, pass metrics or department for a subset, use output 'report' for coverage without the document. It does not explicitly exclude or contrast any other compile-path sibling, so the when-not-to-use side is left to inference.

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