Skip to main content
Glama

BRAINIAC Predictive & Customer Analytics

BG/NBD and Gamma-Gamma customer lifetime value

predictive-analytics_clv-bg-nbd
Read-onlyIdempotent

Fit BG/NBD purchase frequency and Gamma-Gamma spend models, then return P(alive), expected purchases over a horizon, expected value and undiscounted CLV per customer. Price $0.05 USDC. POST /api/v1/predictive-analytics/clv-bg-nbd. An unpaid call returns the x402 payment terms and does not run.

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": {
      "customers": "<customers>"
    },
    "name": "predictive-analytics_clv-bg-nbd"
  }
}

Input Schema

NameRequiredDescriptionDefault
marginNomargin, number. Required.
horizonNohorizon, number. Required.
customersYescustomers, array. Required.
minRepeatCustomersNominRepeatCustomers, integer, from 1 to 100000. Required.

Output Schema

NameRequiredDescriptionDefault
bgnbdNobgnbd. Object.
sourcesNosources. Array.
customersNocustomers. Array.
gammaGammaNogammaGamma. Object.
limitationsNolimitations. Array.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so safety is covered. The description adds genuinely non-obvious behavior beyond that: a $0.05 USDC price via x402, the REST path, and critically that an unpaid call returns payment terms rather than executing. It stops short of disclosing model preconditions (e.g. the minRepeatCustomers requirement) or failure modes.

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

Conciseness5/5

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

Three tight sentences: what it computes and returns, then cost, then endpoint, then the payment precondition. Front-loaded and every sentence carries distinct information with no repetition of the title or annotations.

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

Completeness4/5

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

An output schema exists, so the description is not obligated to enumerate return values (it does anyway), and the payment/execution semantics are fully covered. What remains unaddressed for a statistical modeling endpoint is input data qualification — minimum repeat customers, what happens when the threshold is not met, or whether model fit diagnostics are returned.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema nominally documents all four parameters — though its descriptions are boilerplate ("horizon, number. Required."). The description adds a little meaning by tying "horizon" to expected purchases and confirming per-customer granularity, but says nothing about margin, minRepeatCustomers, or the frequency/recency/T field semantics. Baseline 3 applies.

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 model pair ("Fit BG/NBD purchase frequency and Gamma-Gamma spend models") plus the exact outputs (P(alive), expected purchases over a horizon, expected value, undiscounted CLV). This is unmistakably distinct from every sibling (rfm-segment, cohort-retention, kmeans-cluster, etc.), which are different algorithms entirely.

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

Usage Guidelines3/5

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

Usage is implied by the model names — an agent can infer this is for per-customer CLV forecasting from transaction summaries — but there is no explicit when-to-use / when-not-to-use guidance. It never says why you would pick this over rfm-segment or cohort-retention, nor what data prerequisites (repeat purchase history) qualify a dataset for these models.

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