Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Fit Clv Model

fit_clv_model

Fit a Bayesian Customer Lifetime Value model on RFM transaction data; deprecated in favor of purchase or value model fitting.

Instructions

Fit a Bayesian Customer Lifetime Value (CLV) model on RFM transaction data. (Deprecated: prefer fit_purchase_model or fit_value_model).

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

Input Schema

NameRequiredDescriptionDefault
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "CLVModelConfig": {
      -    "properties": {
      -      "T_column": {
      -        "description": "Column with total observation period length",
      -        "title": "T Column",
      -        "type": "string"
      -      },
      -      "cohort_column": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Column with customer cohort (required for shifted_beta_geo)",
      -        "title": "Cohort Column"
      -      },
      -      "customer_id_column": {
      -        "description": "Column containing unique customer identifiers",
      -        "title": "Customer Id Column",
      -        "type": "string"
      -      },
      -      "frequency_column": {
      -        "description": "Column with repeat purchase count",
      -        "title": "Frequency Column",
      -        "type": "string"
      -      },
      -      "model_type": {
      -        "default": "bg_nbd",
      -        "enum": [
      -          "bg_nbd",
      -          "gamma_gamma",
      -          "shifted_beta_geo"
      -        ],
      -        "title": "Model Type",
      -        "type": "string"
      -      },
      -      "monetary_value_column": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Column with average monetary value per purchase (required for gamma_gamma)",
      -        "title": "Monetary Value Column"
      -      },
      -      "recency_column": {
      -        "description": "Column with recency (time since last purchase)",
      -        "title": "Recency Column",
      -        "type": "string"
      -      },
      -      "sampler": {
      -        "$ref": "#/$defs/SamplerConfig"
      -      }
      -    },
      -    "required": [
      -      "customer_id_column",
      -      "frequency_column",
      -      "recency_column",
      -      "T_column"
      -    ],
      -    "title": "CLVModelConfig",
      -    "type": "object"
      -  },
      -  "FitCLVInput": {
      -    "properties": {
      -      "config": {
      -        "$ref": "#/$defs/CLVModelConfig"
      -      },
      -      "dataset_id": {
      -        "description": "Registered dataset ID containing RFM data",
      -        "title": "Dataset Id",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "dataset_id",
      -      "config"
      -    ],
      -    "title": "FitCLVInput",
      -    "type": "object"
      -  },
      -  "SamplerConfig": {
      -    "properties": {
      -      "chains": {
      -        "default": 4,
      -        "description": "Number of MCMC chains",
      -        "maximum": 8,
      -        "minimum": 2,
      -        "title": "Chains",
      -        "type": "integer"
      -      },
      -      "draws": {
      -        "default": 1000,
      -        "description": "Posterior draws per chain",
      -        "maximum": 20000,
      -        "minimum": 50,
      -        "title": "Draws",
      -        "type": "integer"
      -      },
      -      "random_seed": {
      -        "default": 42,
      -        "description": "Deterministic random seed",
      -        "title": "Random Seed",
      -        "type": "integer"
      -      },
      -      "target_accept": {
      -        "default": 0.9,
      -        "description": "Target acceptance rate for NUTS",
      -        "maximum": 0.999,
      -        "minimum": 0.8,
      -        "title": "Target Accept",
      -        "type": "number"
      -      },
      -      "tune": {
      -        "default": 1000,
      -        "description": "Tuning/warmup iterations per chain",
      -        "maximum": 20000,
      -        "minimum": 50,
      -        "title": "Tune",
      -        "type": "integer"
      -      }
      -    },
      -    "title": "SamplerConfig",
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / config / $ref
      Removed value: -"#/$defs/FitCLVInput"
    • addedInput schema / properties / config / properties
      Added value: +{
      +  "config": {
      +    "properties": {
      +      "T_column": {
      +        "description": "Column with total observation period length",
      +        "title": "T Column",
      +        "type": "string"
      +      },
      +      "cohort_column": {
      +        "default": null,
      +        "description": "Column with customer cohort (required for shifted_beta_geo)",
      +        "title": "Cohort Column",
      +        "type": "string"
      +      },
      +      "customer_id_column": {
      +        "description": "Column containing unique customer identifiers",
      +        "title": "Customer Id Column",
      +        "type": "string"
      +      },
      +      "frequency_column": {
      +        "description": "Column with repeat purchase count",
      +        "title": "Frequency Column",
      +        "type": "string"
      +      },
      +      "model_type": {
      +        "default": "bg_nbd",
      +        "enum": [
      +          "bg_nbd",
      +          "gamma_gamma",
      +          "shifted_beta_geo"
      +        ],
      +        "title": "Model Type",
      +        "type": "string"
      +      },
      +      "monetary_value_column": {
      +        "default": null,
      +        "description": "Column with average monetary value per purchase (required for gamma_gamma)",
      +        "title": "Monetary Value Column",
      +        "type": "string"
      +      },
      +      "recency_column": {
      +        "description": "Column with recency (time since last purchase)",
      +        "title": "Recency Column",
      +        "type": "string"
      +      },
      +      "sampler": {
      +        "properties": {
      +          "chains": {
      +            "default": 4,
      +            "description": "Number of MCMC chains",
      +            "maximum": 8,
      +            "minimum": 2,
      +            "title": "Chains",
      +            "type": "integer"
      +          },
      +          "draws": {
      +            "default": 1000,
      +            "description": "Posterior draws per chain",
      +            "maximum": 20000,
      +            "minimum": 50,
      +            "title": "Draws",
      +            "type": "integer"
      +          },
      +          "random_seed": {
      +            "default": 42,
      +            "description": "Deterministic random seed",
      +            "title": "Random Seed",
      +            "type": "integer"
      +          },
      +          "target_accept": {
      +            "default": 0.9,
      +            "description": "Target acceptance rate for NUTS",
      +            "maximum": 0.999,
      +            "minimum": 0.8,
      +            "title": "Target Accept",
      +            "type": "number"
      +          },
      +          "tune": {
      +            "default": 1000,
      +            "description": "Tuning/warmup iterations per chain",
      +            "maximum": 20000,
      +            "minimum": 50,
      +            "title": "Tune",
      +            "type": "integer"
      +          }
      +        },
      +        "title": "SamplerConfig",
      +        "type": "object"
      +      }
      +    },
      +    "required": [
      +      "customer_id_column",
      +      "frequency_column",
      +      "recency_column",
      +      "T_column"
      +    ],
      +    "title": "CLVModelConfig",
      +    "type": "object"
      +  },
      +  "dataset_id": {
      +    "description": "Registered dataset ID containing RFM data",
      +    "title": "Dataset Id",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / config / required
      Added value: +[
      +  "dataset_id",
      +  "config"
      +]
    • addedInput schema / properties / config / title
      Added value: +"FitCLVInput"
    • addedInput schema / properties / config / type
      Added value: +"object"
  2. First observedv0.4.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=false, so the safety profile is partially covered. The description adds the worthwhile deprecation signal, but says nothing about what the call produces (fitted model handle? registered artifact?) or that MCMC sampling config implies a long-running compute, both of which matter for a non-idempotent fitting tool.

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?

Two short sentences with zero filler: the capability first, the deprecation second. Every clause earns its place and nothing is buried.

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 deeply nested, compute-heavy fitting tool with no output schema, the definition omits what a successful call returns and how long it takes, which an agent needs before invoking MCMC sampling. The deprecation notice partially compensates by steering agents away, but the core call semantics remain thin.

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?

The description adds no parameter meaning at all; the useful semantics (model_type enum, required cohort_column for shifted_beta_geo, required monetary_value_column for gamma_gamma, sampler controls) live entirely in the nested schema. The reported top-level coverage is 0% because the single 'config' wrapper is undocumented, but the nested fields are self-describing, so a mid score reflects the schema doing the work rather than the description.

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 ('Fit a Bayesian CLV model') plus the data domain ('RFM transaction data'), and explicitly names the sibling tools that supersede it. An agent can distinguish this tool from fit_purchase_model and fit_value_model without opening any 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?

The parenthetical 'Deprecated: prefer fit_purchase_model or fit_value_model' gives an explicit routing away from this tool, which is stronger than most definitions. However, it never says which of the two successors to choose or under what condition this tool should still be used, so the guidance is directional but incomplete.

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