Skip to main content
Glama
PyMC Marketing MCP

PyMC Marketing MCP

by funnelscript

Select Best Model

select_best_model
Read-onlyIdempotent

Compare multiple fitted MMMs on the same dataset using PSIS-LOO, WAIC, or Bayesian stacking, then get ranked specifications, criterion scores, and a recommended model ID.

Instructions

Compare multiple fitted MMMs using PSIS-LOO, WAIC, or Bayesian stacking weights via ArviZ. All models must be fitted on the same dataset. Returns ranked specifications, LOO/WAIC scores, and recommended model ID. Methods: loo (PSIS-LOO), waic (WAIC), stacking (BMA weights), all (run all three).

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

Input Schema

NameRequiredDescriptionDefault
configYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / $defs
      Removed value: -{
      -  "ModelComparisonInput": {
      -    "properties": {
      -      "criterion": {
      -        "default": "loo",
      -        "description": "Information criterion: 'loo' (PSIS-LOO), 'waic', or 'both'",
      -        "enum": [
      -          "loo",
      -          "waic",
      -          "both"
      -        ],
      -        "title": "Criterion",
      -        "type": "string"
      -      },
      -      "method": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Deprecated: use `criterion` and `weighting` instead",
      -        "title": "Method"
      -      },
      -      "model_ids": {
      -        "description": "List of 2–10 model IDs to compare. All must be fitted on the same dataset.",
      -        "items": {
      -          "type": "string"
      -        },
      -        "maxItems": 10,
      -        "minItems": 2,
      -        "title": "Model Ids",
      -        "type": "array"
      -      },
      -      "weighting": {
      -        "default": "stacking",
      -        "description": "Model weighting method: 'stacking', 'bb-pseudo-bma', or 'pseudo-bma'",
      -        "enum": [
      -          "stacking",
      -          "bb-pseudo-bma",
      -          "pseudo-bma"
      -        ],
      -        "title": "Weighting",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "model_ids"
      -    ],
      -    "title": "ModelComparisonInput",
      -    "type": "object"
      -  }
      -}
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / config / $ref
      Removed value: -"#/$defs/ModelComparisonInput"
    • addedInput schema / properties / config / properties
      Added value: +{
      +  "criterion": {
      +    "default": "loo",
      +    "description": "Information criterion: 'loo' (PSIS-LOO), 'waic', or 'both'",
      +    "enum": [
      +      "loo",
      +      "waic",
      +      "both"
      +    ],
      +    "title": "Criterion",
      +    "type": "string"
      +  },
      +  "method": {
      +    "default": null,
      +    "description": "Deprecated: use `criterion` and `weighting` instead",
      +    "title": "Method",
      +    "type": "string"
      +  },
      +  "model_ids": {
      +    "description": "List of 2–10 model IDs to compare. All must be fitted on the same dataset.",
      +    "items": {
      +      "type": "string"
      +    },
      +    "maxItems": 10,
      +    "minItems": 2,
      +    "title": "Model Ids",
      +    "type": "array"
      +  },
      +  "weighting": {
      +    "default": "stacking",
      +    "description": "Model weighting method: 'stacking', 'bb-pseudo-bma', or 'pseudo-bma'",
      +    "enum": [
      +      "stacking",
      +      "bb-pseudo-bma",
      +      "pseudo-bma"
      +    ],
      +    "title": "Weighting",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / config / required
      Added value: +[
      +  "model_ids"
      +]
    • addedInput schema / properties / config / title
      Added value: +"ModelComparisonInput"
    • addedInput schema / properties / config / type
      Added value: +"object"
  2. First observedv0.4.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, and closed-world, so the safety profile is covered. The description adds value beyond that by specifying the model-comparability constraint and enumerating the outputs (ranked specifications, LOO/WAIC scores, recommended model ID), though it says nothing about cost/runtime of comparing up to 10 models.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences: purpose first, constraint second, return values third, then a compact method legend. The only waste is the method legend, which duplicates and partly conflicts with schema fields rather than adding new information.

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 the work of stating what comes back (rankings, scores, recommended model ID), and it supplies the critical same-dataset prerequisite for a nested-config tool. It is not fully complete because it omits guidance relative to sibling comparison tools and how ties or non-converged models are handled.

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 description frames the input as a single 'method' selector with values loo/waic/stacking/all, but the schema actually splits this into 'criterion' (loo/waic/both) and 'weighting' (stacking/bb-pseudo-bma/pseudo-bma); 'all' is not a valid value and maps at best to criterion='both'. The 'method' parameter it echoes is explicitly marked deprecated. This creates a misleading mental model for an agent filling the nested config, despite useful glosses like 'BMA weights' and 'PSIS-LOO'.

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+resource ('Compare multiple fitted MMMs') and names the statistical machinery (PSIS-LOO, WAIC, Bayesian stacking via ArviZ), plus what it returns. It does not differentiate from the sibling 'compare_models', leaving an agent to guess which comparison tool to pick.

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 one real prerequisite ('all models must be fitted on the same dataset') and enumerates method choices, which implies when the tool applies. However, there is no explicit guidance on when to choose this over 'compare_models' or 'cross_validate_mmm', and no exclusions.

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