gasp-standard-mcp 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,11 +46,13 @@ Restart your MCP client after adding the config.
46
46
 
47
47
  - 300 metrics across 13 departments
48
48
  - 80 glossary definitions
49
- - 76 relationship nodes (60 metrics + 11 entities + 5 concepts), 149 edges
49
+ - 76 relationship nodes (60 metrics + 11 entities + 5 concepts), 157 edges
50
50
  - 15 entity-to-entity business model edges (OWNS, GRANTS, CONVERTS_TO, GENERATES, etc.)
51
51
  - 78 data requirements with field types, grain, and example SQL
52
- - 11 business entities, 5 business concepts, 22 source categories, 197 canonical fields
52
+ - 11 business entities, 5 business concepts, 22 source categories, 198 canonical fields
53
+ - 60 structured formulas with decomposed inputs (metric refs + field refs)
53
54
  - 60 temporal mappings (grain, frequency, period for every metric node)
55
+ - CEL `change_nature` field for revenue quality analysis (Adjusted NRR/GRR)
54
56
  - Sources: the canonical [GASP Standard](https://gaspwiki.com) files
55
57
 
56
58
  ## Examples
package/build/index.js CHANGED
@@ -148,6 +148,16 @@ server.tool("lookup_metric", "Look up a GASP Standard metric by name or abbrevia
148
148
  if (metric.dualLensNote) {
149
149
  parts.push(`\n## Dual-Lens Note\n\n${metric.dualLensNote}`);
150
150
  }
151
+ // Adjusted variant from structured formulas (e.g. NRR, GRR)
152
+ const sfMap = data.ontology?.structuredFormulas;
153
+ if (sfMap) {
154
+ const nodeId = metric.slug.replace(/-/g, '_');
155
+ const sf = sfMap[nodeId]
156
+ || Object.entries(sfMap).find(([k]) => k !== 'description' && nodeId.startsWith(k + '_'))?.[1];
157
+ if (sf && typeof sf === 'object' && 'adjustedVariant' in sf) {
158
+ parts.push(`\n## Adjusted Variant\n\n${sf.adjustedVariant}`);
159
+ }
160
+ }
151
161
  // Swap EOM → GASP branding
152
162
  const text = parts.join("\n").replace(/\bEOM Standard\b/g, "GASP Standard");
153
163
  return { content: [{ type: "text", text }] };
@@ -240,6 +250,35 @@ server.tool("get_formula", "Get the formula(s) for a GASP Standard metric. Retur
240
250
  }
241
251
  parts.push("```\n" + metric.formulas[i] + "\n```\n");
242
252
  }
253
+ // Append structured formula references if available
254
+ const formulas = data.ontology?.structuredFormulas;
255
+ const nodeId = metric.slug.replace(/-/g, '_');
256
+ // Match: exact node ID, or slug starts with a formula key (e.g. "arr_annual_recurring_revenue" starts with "arr")
257
+ let structured = formulas?.[nodeId];
258
+ if (!structured && formulas) {
259
+ for (const [key, val] of Object.entries(formulas)) {
260
+ if (key !== 'description' && nodeId.startsWith(key + '_')) {
261
+ structured = val;
262
+ break;
263
+ }
264
+ }
265
+ }
266
+ if (structured) {
267
+ if (structured.inputs && structured.inputs.length > 0) {
268
+ parts.push("## Inputs (metric dependencies)");
269
+ for (const input of structured.inputs) {
270
+ const inputNode = data.nodes.find(n => n.id === input.ref);
271
+ const label = inputNode?.label || input.ref;
272
+ parts.push(`- **${label}** (${input.role})`);
273
+ }
274
+ parts.push("");
275
+ }
276
+ if (structured.fields && structured.fields.length > 0) {
277
+ parts.push("## Required fields");
278
+ parts.push(structured.fields.map(f => `\`${f}\``).join(", "));
279
+ parts.push("");
280
+ }
281
+ }
243
282
  const text = parts.join("\n").replace(/\bEOM Standard\b/g, "GASP Standard");
244
283
  return { content: [{ type: "text", text }] };
245
284
  });
package/build/loader.js CHANGED
@@ -117,6 +117,7 @@ export function loadStandard() {
117
117
  entityMappings: ontRaw.entityMappings || {},
118
118
  concepts: ontRaw.concepts || [],
119
119
  entityRelationships: ontRaw.entityRelationships || undefined,
120
+ structuredFormulas: ontRaw.structuredFormulas || undefined,
120
121
  };
121
122
  }
122
123
  catch {