Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Fit Value Model

fit_value_model

Fit a Bayesian Gamma-Gamma model to repeat customer spending using frequency and average monetary value columns to estimate expected transaction value.

Instructions

Fit a Bayesian monetary value transaction model (Gamma-Gamma) on repeat customer spending. Requires frequency and average monetary value columns.

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_value_model"
  }
}

Input Schema

NameRequiredDescriptionDefault
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "FitValueModelInput": {
      -    "properties": {
      -      "customer_id_col": {
      -        "default": "customer_id",
      -        "description": "Column containing unique customer identifiers",
      -        "title": "Customer Id Col",
      -        "type": "string"
      -      },
      -      "dataset_id": {
      -        "description": "Registered dataset ID containing monetary transaction data",
      -        "title": "Dataset Id",
      -        "type": "string"
      -      },
      -      "frequency_col": {
      -        "default": "frequency",
      -        "description": "Column with repeat purchase count",
      -        "title": "Frequency Col",
      -        "type": "string"
      -      },
      -      "model_type": {
      -        "const": "gamma_gamma",
      -        "default": "gamma_gamma",
      -        "description": "Value model type: 'gamma_gamma'",
      -        "title": "Model Type",
      -        "type": "string"
      -      },
      -      "monetary_value_col": {
      -        "default": "monetary_value",
      -        "description": "Column with average monetary value per transaction",
      -        "title": "Monetary Value Col",
      -        "type": "string"
      -      },
      -      "sampler": {
      -        "$ref": "#/$defs/SamplerConfig"
      -      }
      -    },
      -    "required": [
      -      "dataset_id"
      -    ],
      -    "title": "FitValueModelInput",
      -    "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/FitValueModelInput"
    • addedInput schema / properties / config / properties
      Added value: +{
      +  "customer_id_col": {
      +    "default": "customer_id",
      +    "description": "Column containing unique customer identifiers",
      +    "title": "Customer Id Col",
      +    "type": "string"
      +  },
      +  "dataset_id": {
      +    "description": "Registered dataset ID containing monetary transaction data",
      +    "title": "Dataset Id",
      +    "type": "string"
      +  },
      +  "frequency_col": {
      +    "default": "frequency",
      +    "description": "Column with repeat purchase count",
      +    "title": "Frequency Col",
      +    "type": "string"
      +  },
      +  "model_type": {
      +    "const": "gamma_gamma",
      +    "default": "gamma_gamma",
      +    "description": "Value model type: 'gamma_gamma'",
      +    "title": "Model Type",
      +    "type": "string"
      +  },
      +  "monetary_value_col": {
      +    "default": "monetary_value",
      +    "description": "Column with average monetary value per transaction",
      +    "title": "Monetary Value Col",
      +    "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"
      +  }
      +}
    • addedInput schema / properties / config / required
      Added value: +[
      +  "dataset_id"
      +]
    • addedInput schema / properties / config / title
      Added value: +"FitValueModelInput"
    • addedInput schema / properties / config / type
      Added value: +"object"
  2. First observedv0.4.0

TDQS

A3.5/5.0
Behavior3/5

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

The annotations already establish that this is a non-read-only, non-destructive, closed-world operation. The description adds that the fit is Bayesian Gamma-Gamma on repeat spending, but it does not explain runtime behavior, whether fitting is long-running, or whether the result is a fitted model artifact versus a job handle.

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?

The description is two concise sentences with the model type and data prerequisite front-loaded. There is no unnecessary wording or repetition.

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 model-fitting tool with a nested configuration object and no output schema, the description covers the core data prerequisites but omits return behavior and long-running execution semantics. It is adequate but leaves meaningful gaps for an agent planning the call.

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 schema documents many nested configuration fields, including sampler settings and column mappings, while the description only adds the key data requirements around frequency and monetary value columns. It does not clarify dataset_id, customer_id_col, or the sampler configuration, so it adds some meaning but does not fully compensate for the top-level schema description gap.

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?

The description states a specific verb and resource: fit a Bayesian Gamma-Gamma monetary value model on repeat customer spending. It clearly identifies the model family, but does not explicitly distinguish this from sibling model-fitting tools such as fit_clv_model or fit_purchase_model.

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?

It gives useful usage context by saying the tool is for repeat customer spending and requires frequency and average monetary value columns. However, it does not say when to choose this model over competing model-fitting siblings or when it is inappropriate.

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