Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Predict Expected Purchases

predict_expected_purchases
Read-onlyIdempotent

Predict future purchase counts per customer from a fitted BG/NBD model to forecast customer activity and prioritize top buyers over a chosen horizon.

Instructions

Predict expected future purchase counts per customer from a fitted purchase model (BG/NBD).

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

Input Schema

NameRequiredDescriptionDefault
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "PredictExpectedPurchasesInput": {
      -    "properties": {
      -      "future_t": {
      -        "default": 12,
      -        "description": "Number of future periods to forecast",
      -        "maximum": 104,
      -        "minimum": 1,
      -        "title": "Future T",
      -        "type": "integer"
      -      },
      -      "model_id": {
      -        "description": "Fitted purchase model ID (BG/NBD)",
      -        "title": "Model Id",
      -        "type": "string"
      -      },
      -      "top_n": {
      -        "anyOf": [
      -          {
      -            "maximum": 10000,
      -            "minimum": 1,
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Return top N customers by expected purchases",
      -        "title": "Top N"
      -      }
      -    },
      -    "required": [
      -      "model_id"
      -    ],
      -    "title": "PredictExpectedPurchasesInput",
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / config / $ref
      Removed value: -"#/$defs/PredictExpectedPurchasesInput"
    • addedInput schema / properties / config / properties
      Added value: +{
      +  "future_t": {
      +    "default": 12,
      +    "description": "Number of future periods to forecast",
      +    "maximum": 104,
      +    "minimum": 1,
      +    "title": "Future T",
      +    "type": "integer"
      +  },
      +  "model_id": {
      +    "description": "Fitted purchase model ID (BG/NBD)",
      +    "title": "Model Id",
      +    "type": "string"
      +  },
      +  "top_n": {
      +    "default": null,
      +    "description": "Return top N customers by expected purchases",
      +    "title": "Top N",
      +    "type": "integer"
      +  }
      +}
    • addedInput schema / properties / config / required
      Added value: +[
      +  "model_id"
      +]
    • addedInput schema / properties / config / title
      Added value: +"PredictExpectedPurchasesInput"
    • addedInput schema / properties / config / type
      Added value: +"object"
  2. First observedv0.4.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already establish read-only, idempotent, non-destructive, and closed-world behavior. The description adds that the output is per-customer future purchase counts from a fitted BG/NBD model, but it does not describe response shape, ordering, or failure conditions.

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?

It is a single focused sentence with the core prediction target and model dependency front-loaded. There is no redundant wording or structural clutter.

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?

For a simple prediction tool with strong annotations and a schema that documents its nested parameters, the description gives enough context to know what is predicted and what model it depends on. It stops short of explaining alternatives or return-value details, but the essentials are present.

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 does not mention top_n, future_t, or model_id directly. However, the input schema itself provides descriptions for the nested parameters, so the description only adds the model-family context and per-customer output framing.

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?

The description states a specific prediction verb and resource: expected future purchase counts per customer. It also names the model family (BG/NBD), which distinguishes it from spend prediction or probability-alive siblings.

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 phrase 'from a fitted purchase model' implies a prerequisite, but it does not explicitly say when to choose this tool over alternatives such as predict_expected_spend or predict_customer_clv. Usage is therefore inferable but not directly guided.

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