Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Cross Validate Mmm

cross_validate_mmm
Idempotent

Run rolling time-slice cross-validation on fitted PyMC-Marketing models to measure out-of-sample predictive RMSE/NRMSE across temporal folds.

Instructions

Run rolling Time-Slice Cross-Validation with PyMC-Marketing. Evaluates out-of-sample predictive RMSE/NRMSE across multiple temporal folds.

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": {
      "input": "<input>"
    },
    "name": "cross_validate_mmm"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "CrossValidateMMMInput": {
      -    "properties": {
      -      "forecast_horizon": {
      -        "default": 10,
      -        "description": "Out-of-sample forecast window size",
      -        "maximum": 52,
      -        "minimum": 1,
      -        "title": "Forecast Horizon",
      -        "type": "integer"
      -      },
      -      "model_id": {
      -        "description": "Fitted model ID to cross-validate",
      -        "title": "Model Id",
      -        "type": "string"
      -      },
      -      "n_init": {
      -        "default": 40,
      -        "description": "Initial training period count",
      -        "maximum": 500,
      -        "minimum": 10,
      -        "title": "N Init",
      -        "type": "integer"
      -      },
      -      "sampler": {
      -        "$ref": "#/$defs/SamplerConfig",
      -        "description": "Sampler settings for fold fitting"
      -      },
      -      "step_size": {
      -        "default": 10,
      -        "description": "Step size between rolling folds",
      -        "maximum": 52,
      -        "minimum": 1,
      -        "title": "Step Size",
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "model_id"
      -    ],
      -    "title": "CrossValidateMMMInput",
      -    "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 / input / $ref
      Removed value: -"#/$defs/CrossValidateMMMInput"
    • addedInput schema / properties / input / properties
      Added value: +{
      +  "forecast_horizon": {
      +    "default": 10,
      +    "description": "Out-of-sample forecast window size",
      +    "maximum": 52,
      +    "minimum": 1,
      +    "title": "Forecast Horizon",
      +    "type": "integer"
      +  },
      +  "model_id": {
      +    "description": "Fitted model ID to cross-validate",
      +    "title": "Model Id",
      +    "type": "string"
      +  },
      +  "n_init": {
      +    "default": 40,
      +    "description": "Initial training period count",
      +    "maximum": 500,
      +    "minimum": 10,
      +    "title": "N Init",
      +    "type": "integer"
      +  },
      +  "sampler": {
      +    "description": "Sampler settings for fold fitting",
      +    "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"
      +  },
      +  "step_size": {
      +    "default": 10,
      +    "description": "Step size between rolling folds",
      +    "maximum": 52,
      +    "minimum": 1,
      +    "title": "Step Size",
      +    "type": "integer"
      +  }
      +}
    • addedInput schema / properties / input / required
      Added value: +[
      +  "model_id"
      +]
    • addedInput schema / properties / input / title
      Added value: +"CrossValidateMMMInput"
    • addedInput schema / properties / input / 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=false, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the substantive detail that this performs rolling temporal-fold evaluation with out-of-sample metrics, but it omits runtime/cost expectations and whether any artifacts are persisted despite the non-read-only annotation.

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 tight sentences, front-loaded with the action and method, with zero redundant wording. Nothing is repeated from the schema 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?

With no output schema, the description does state the returned metrics (RMSE/NRMSE per fold), which is the key return-value information. Remaining gaps are runtime/cost and the lack of distinction from the job-submission sibling, but for a one-parameter wrapper tool this is close to complete.

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 nested schema already documents every leaf parameter (n_init, step_size, forecast_horizon, sampler settings) with descriptions and bounds, so the schema carries the load. The description adds no meaning about fold construction, how step_size interacts with forecast_horizon, or what model_id must reference, leaving the top-level 'input' wrapper undocumented.

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 ('Run rolling Time-Slice Cross-Validation with PyMC-Marketing') and names the evaluated metric family (out-of-sample RMSE/NRMSE across temporal folds). It is clear what the tool computes, but it does not differentiate itself from the sibling 'submit_cross_validate_mmm_job', which appears to be the same operation in job form.

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

Usage Guidelines2/5

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

There is no guidance on when to use this tool versus the submit_cross_validate_mmm_job sibling (sync vs. async), nor on prerequisites such as requiring an already fitted model_id. The agent must infer the workflow position from the tool name and sibling list alone.

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