Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Calibrate Mmm

calibrate_mmm
Idempotent

Calibrate an existing Bayesian MMM with experimental lift test measurements to improve causal accuracy and produce a new lineage-linked model artifact.

Instructions

Calibrate an existing MMM using experimental lift test measurements. Produces a new calibrated model artifact linked via lineage.

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

Input Schema

NameRequiredDescriptionDefault
inputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "CalibrateMMMInput": {
      -    "properties": {
      -      "lift_tests": {
      -        "description": "Lift test experimental measurements",
      -        "items": {
      -          "$ref": "#/$defs/LiftTestMeasurement"
      -        },
      -        "maxItems": 100,
      -        "minItems": 1,
      -        "title": "Lift Tests",
      -        "type": "array"
      -      },
      -      "model_id": {
      -        "description": "Fitted base model ID to calibrate",
      -        "title": "Model Id",
      -        "type": "string"
      -      },
      -      "sampler": {
      -        "$ref": "#/$defs/SamplerConfig",
      -        "description": "Sampler settings for calibration fit"
      -      }
      -    },
      -    "required": [
      -      "model_id",
      -      "lift_tests"
      -    ],
      -    "title": "CalibrateMMMInput",
      -    "type": "object"
      -  },
      -  "LiftTestMeasurement": {
      -    "properties": {
      -      "channel": {
      -        "description": "Marketing channel name",
      -        "title": "Channel",
      -        "type": "string"
      -      },
      -      "delta_x": {
      -        "description": "Spend or volume increment during experiment",
      -        "exclusiveMinimum": 0,
      -        "title": "Delta X",
      -        "type": "number"
      -      },
      -      "delta_y": {
      -        "description": "Measured incremental KPI response",
      -        "title": "Delta Y",
      -        "type": "number"
      -      },
      -      "description": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Experiment description or study identifier",
      -        "title": "Description"
      -      },
      -      "geo": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Optional geography dimension value",
      -        "title": "Geo"
      -      },
      -      "sigma": {
      -        "description": "Standard error/uncertainty of the measured incremental KPI",
      -        "exclusiveMinimum": 0,
      -        "title": "Sigma",
      -        "type": "number"
      -      },
      -      "x": {
      -        "description": "Baseline media spend or volume level during experiment",
      -        "minimum": 0,
      -        "title": "X",
      -        "type": "number"
      -      }
      -    },
      -    "required": [
      -      "channel",
      -      "x",
      -      "delta_x",
      -      "delta_y",
      -      "sigma"
      -    ],
      -    "title": "LiftTestMeasurement",
      -    "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/CalibrateMMMInput"
    • addedInput schema / properties / input / properties
      Added value: +{
      +  "experiment_ids": {
      +    "description": "Registered experiment IDs from Experiment Evidence Registry",
      +    "items": {
      +      "type": "string"
      +    },
      +    "maxItems": 100,
      +    "title": "Experiment Ids",
      +    "type": "array"
      +  },
      +  "lift_tests": {
      +    "description": "Lift test experimental measurements",
      +    "items": {
      +      "properties": {
      +        "channel": {
      +          "description": "Marketing channel name",
      +          "title": "Channel",
      +          "type": "string"
      +        },
      +        "delta_x": {
      +          "description": "Spend or volume increment during experiment",
      +          "exclusiveMinimum": 0,
      +          "title": "Delta X",
      +          "type": "number"
      +        },
      +        "delta_y": {
      +          "description": "Measured incremental KPI response",
      +          "title": "Delta Y",
      +          "type": "number"
      +        },
      +        "description": {
      +          "default": null,
      +          "description": "Experiment description or study identifier",
      +          "title": "Description",
      +          "type": "string"
      +        },
      +        "geo": {
      +          "default": null,
      +          "description": "Optional geography dimension value",
      +          "title": "Geo",
      +          "type": "string"
      +        },
      +        "sigma": {
      +          "description": "Standard error/uncertainty of the measured incremental KPI",
      +          "exclusiveMinimum": 0,
      +          "title": "Sigma",
      +          "type": "number"
      +        },
      +        "x": {
      +          "description": "Baseline media spend or volume level during experiment",
      +          "minimum": 0,
      +          "title": "X",
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "channel",
      +        "x",
      +        "delta_x",
      +        "delta_y",
      +        "sigma"
      +      ],
      +      "title": "LiftTestMeasurement",
      +      "type": "object"
      +    },
      +    "maxItems": 100,
      +    "title": "Lift Tests",
      +    "type": "array"
      +  },
      +  "model_id": {
      +    "description": "Fitted base model ID to calibrate",
      +    "title": "Model Id",
      +    "type": "string"
      +  },
      +  "sampler": {
      +    "description": "Sampler settings for calibration fit",
      +    "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 / input / required
      Added value: +[
      +  "model_id"
      +]
    • addedInput schema / properties / input / title
      Added value: +"CalibrateMMMInput"
    • addedInput schema / properties / input / type
      Added value: +"object"
  2. First observedv0.4.0

TDQS

B3.3/5.0
Behavior3/5

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

The annotations already declare non-read-only, non-destructive, idempotent behavior; the description adds only that a NEW artifact is produced with lineage rather than the original being mutated, which is genuinely useful. It says nothing about cost/runtime, whether this runs synchronously or should go through a job-submission sibling, or how lift-test quality affects the result.

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 sentences, zero filler, with the action front-loaded and the artifact/lineage consequence immediately after. Nothing could be cut without losing meaning.

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-input tool with no output schema, the description covers the return shape ('new calibrated model artifact linked via lineage') but omits the top-level input structure and the synchronous-vs-job execution model. An agent has enough to know what it does, but not enough to invoke it without reading the whole nested schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single top-level 'input' parameter has no schema description (coverage reported as 0%), so the description must carry the load and it does not: model_id, lift_tests, experiment_ids and the sampler settings are never mentioned. An agent must open the nested schema to learn that lift tests and a model ID are the actual payload.

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 ('Calibrate an existing MMM') plus the required input class ('experimental lift test measurements'), which implicitly distinguishes it from fit_mmm by requiring an already-fitted base model. It falls short of a 5 because it never names fit_mmm or any sibling as the alternative, leaving the distinction to inference.

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?

'existing MMM' and 'lift test measurements' imply the precondition (a fitted model plus measured experiments) but never state it as a rule or note what to do when no lift tests exist. No when-not-to-use or alternative routing is given, so usage is only implied.

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