Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Estimate Customer Lifetime Value

estimate_customer_lifetime_value
Read-onlyIdempotent

Estimate discounted net present customer lifetime value by combining fitted purchase and monetary value models, then forecast future periods and rank top customers.

Instructions

Estimate discounted net present Customer Lifetime Value (CLV) by combining a fitted purchase model (e.g. BG/NBD) and monetary value model (e.g. Gamma-Gamma).

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": {
      "config": "<config>"
    },
    "name": "estimate_customer_lifetime_value"
  }
}

Input Schema

NameRequiredDescriptionDefault
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "EstimateCLVInput": {
      -    "properties": {
      -      "discount_rate": {
      -        "default": 0,
      -        "description": "Periodic discount rate for NPV",
      -        "maximum": 1,
      -        "minimum": 0,
      -        "title": "Discount Rate",
      -        "type": "number"
      -      },
      -      "future_t": {
      -        "default": 12,
      -        "description": "Number of future periods to forecast",
      -        "maximum": 104,
      -        "minimum": 1,
      -        "title": "Future T",
      -        "type": "integer"
      -      },
      -      "purchase_model_id": {
      -        "description": "Fitted transaction/purchase model ID (e.g. BG/NBD)",
      -        "title": "Purchase Model Id",
      -        "type": "string"
      -      },
      -      "top_n": {
      -        "anyOf": [
      -          {
      -            "maximum": 10000,
      -            "minimum": 1,
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Return top N customers by predicted CLV",
      -        "title": "Top N"
      -      },
      -      "value_model_id": {
      -        "description": "Fitted monetary value model ID (e.g. Gamma-Gamma)",
      -        "title": "Value Model Id",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "purchase_model_id",
      -      "value_model_id"
      -    ],
      -    "title": "EstimateCLVInput",
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / config / $ref
      Removed value: -"#/$defs/EstimateCLVInput"
    • addedInput schema / properties / config / properties
      Added value: +{
      +  "discount_rate": {
      +    "default": 0,
      +    "description": "Periodic discount rate for NPV",
      +    "maximum": 1,
      +    "minimum": 0,
      +    "title": "Discount Rate",
      +    "type": "number"
      +  },
      +  "future_t": {
      +    "default": 12,
      +    "description": "Number of future periods to forecast",
      +    "maximum": 104,
      +    "minimum": 1,
      +    "title": "Future T",
      +    "type": "integer"
      +  },
      +  "purchase_model_id": {
      +    "description": "Fitted transaction/purchase model ID (e.g. BG/NBD)",
      +    "title": "Purchase Model Id",
      +    "type": "string"
      +  },
      +  "top_n": {
      +    "default": null,
      +    "description": "Return top N customers by predicted CLV",
      +    "title": "Top N",
      +    "type": "integer"
      +  },
      +  "value_model_id": {
      +    "description": "Fitted monetary value model ID (e.g. Gamma-Gamma)",
      +    "title": "Value Model Id",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / config / required
      Added value: +[
      +  "purchase_model_id",
      +  "value_model_id"
      +]
    • addedInput schema / properties / config / title
      Added value: +"EstimateCLVInput"
    • addedInput schema / properties / config / type
      Added value: +"object"
  2. First observedv0.4.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is fully covered structurally. The description adds that estimation is discounted-NPV based and depends on two fitted models, but says nothing about compute cost, failure modes with mismatched model IDs, or the shape of what comes back.

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?

A single front-loaded sentence that leads with the verb and the core computation, with the model-pairing detail appended. Nothing is padded, but it is thin for a tool with a nested config object and no output schema.

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

Completeness3/5

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

For a nested-object tool with no output schema, the definition covers the central computation and the dependency on two fitted models, which is the key correctness constraint. It omits the workflow sequencing (which fit tools must run first) and any hint about return granularity, leaving real gaps for an agent assembling a multi-step pipeline.

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?

Top-level coverage registers as 0% because the single `config` object itself is undocumented, but its nested properties (top_n, future_t with 1-104 bounds, discount_rate 0-1, and both model IDs) carry their own descriptions in the schema. The description adds no semantics beyond that - it never explains how discount_rate interacts with future_t or what top_n=None returns - so this sits at the baseline.

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?

States a specific verb and resource ("Estimate discounted net present Customer Lifetime Value") plus the actual method: combining a fitted purchase model (BG/NBD) with a monetary value model (Gamma-Gamma). That method-level detail distinguishes it from the adjacent fit_* and predict_customer_clv siblings, though it never names an alternative explicitly.

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?

The word "fitted" implies the prerequisite that purchase_model_id and value_model_id must come from prior fitting steps, so usage context is implied rather than stated. There is no explicit guidance on when to choose this over predict_customer_clv or on the required call ordering (fit_purchase_model / fit_value_model first).

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