Skip to main content
TagManifest /Docs Dashboard

evaluate_rule

MCP tool that runs a single rule against a container and returns the full finding, with every affected item.

On this page 6

Summary

  • tool — evaluate_rule
  • purpose — run one rule against a container; return the full finding
  • rest equivalent — POST /v1/evaluate-rule (the REST response also carries evaluated_at and duration_ms)
  • rate limit — 500/day per user
  • synchronous — yes

Runs a single rule against a container and returns the finding as the rule engine produced it: every affected item and the evidence, nothing trimmed. Use it to check one rule on a site, to look closer at a finding from scan_url, or to confirm a fix after a container change.

TOOLevaluate_rule

When to use it

Use evaluate_rule when you already know which rule you care about.

  • vs scan_url — scan_url runs all rules and returns thin findings: the first 3 affected items and no evidence. evaluate_rule runs one rule and returns the complete affectedItems list and the evidence. Start with scan_url, then call evaluate_rule on the finding you want to look at.
  • vs list_rules and get_rule — those read rule metadata and never touch a container. evaluate_rule runs the rule. To find the right rule_id, call list_rules first.

Arguments

ArgumentTypeRequiredDescription
rule_idstringrequiredRule ID to run (for example ga4-pii-parameter-names). Use list_rules to find IDs.
urlstringone ofAddress of the page whose container to check. A full URL (https://example.com), a bare domain (example.com, scanned over https), or a GTM ID (GTM-XXXXX) are all accepted. The tool's own schema says "Full URL"; the other two forms work as well.
gtm_idstringone ofGTM container ID (GTM-XXXXX, upper case). The page is not fetched.
dataobjectone ofA GTM JSON export as downloaded from GTM, or container data already parsed by TagManifest. Nothing is fetched.

One of url, gtm_id, or data is needed alongside rule_id. If data is present it is used and the other two are ignored.

Synchronous. The tool returns when the rule has run. No polling, no webhooks. A fetched container is reused for up to five minutes.

Returns

The tool result is one text block. Its text is a JSON object:

FieldMeaning
rule_idThe rule that ran.
firedtrue when the rule produced at least one finding.
finding_countThe number of findings. 0 when the rule did not fire.
findingsThe findings, as the rule engine produced them. Empty when the rule did not fire.
containergtm_id, tag_count, and from_cache. gtm_id is read from the container. When a parsed container in data carries no ID, a gtm_id passed in the same call is used; with neither, it is null.

Findings here are not the thin findings that scan_url returns. The field names are the rule engine's own, in camelCase: ruleId, severity, category, title, description, affectedItems, evidence, recommendation, action, tier. affectedItems holds the affected items the rule reports (some rules list only the first 10 or 20). The shape of each affected item and of evidence depends on the rule.

Caching. On MCP the cache field is container.from_cache. It is true when a stored copy of the container was used, false when the container was fetched from Google, and null when the container came from data.

{
  "rule_id": "ga4-pii-parameter-names",
  "fired": true,
  "finding_count": 1,
  "findings": [
    {
      "ruleId": "ga4-pii-parameter-names",
      "severity": "critical",
      "category": "ga4",
      "title": "GA4 parameters with PII-suggesting names",
      "description": "1 GA4 tags include parameters with names suggesting personally identifiable information (email, phone, name, etc.). Sending PII to GA4 violates Google's Terms of Service and may violate privacy regulations.",
      "affectedItems": [
        { "id": "2", "name": "GA4 - Contact form", "piiParams": ["email"] }
      ],
      "evidence": [
        {
          "tagId": "2",
          "params": [
            { "name": "email", "value": "jane@example.com..." }
          ]
        }
      ],
      "recommendation": "Remove PII parameters, or hash them with SHA-256 before sending. Ensure any user-provided data sent to GA4 is properly anonymized.",
      "action": "Remove or hash PII data",
      "tier": "error"
    }
  ],
  "container": {
    "gtm_id": "GTM-EXAMPLE",
    "tag_count": 4,
    "from_cache": false
  }
}

When the rule does not fire, the result is "fired": false, "finding_count": 0 and an empty findings list.

Errors

  • Bad arguments come back as a JSON-RPC error with code -32602. This covers a missing rule_id, an argument the tool does not accept (the message suggests the nearest name), and an argument of the wrong type. category, tier and top_n are not arguments of this tool. These are checked before the rate limit, so they do not count against it.
  • A run that fails comes back as a normal tool result with isError: true and a plain message in the text block. Examples: a rule_id that does not exist (Unknown rule_id: …), none of url, gtm_id or data given, a page with no GTM snippet, or a GTM ID that Google has no public container for. These calls do count against the rate limit.
  • Rate limit comes back as a JSON-RPC error with code -32603 and the message Rate limit exceeded for evaluate_rule: 501/500. Resets at <time>. The HTTP status is 200. MCP responses carry no X-RateLimit-* headers. The limit resets at midnight UTC.

Try saying

Natural-language prompts that route to this tool through an agent:

  • "Check rule ga4-pii-parameter-names against example.com. Did it fire?"
  • "I added a Conversion Linker. Re-run missing-conversion-linker on GTM-XXXXX and tell me if it still flags."
  • "Show me every tag that eval-usage flags in this export."

For agents wired to your own application:

You have access to TagManifest's MCP server. Use the evaluate_rule
tool to run a single audit rule against a GTM container and return
the complete finding. The tool requires a rule_id plus one of url,
gtm_id, or data. It returns fired (boolean), finding_count, the full
findings array with all affectedItems, and a container summary.

See also

  • scan_url — run all rules against a container; returns thin findings
  • list_rules — browse the rule catalog to find rule IDs
  • Health score — how rule findings combine into the container score

Examples

MCP tool call
{
  "tool": "evaluate_rule",
  "arguments": {
    "rule_id": "ga4-pii-parameter-names",
    "url": "https://example.com"
  }
}
Tool result
{
  "rule_id": "ga4-pii-parameter-names",
  "fired": true,
  "finding_count": 1,
  "findings": [
    {
      "ruleId": "ga4-pii-parameter-names",
      "severity": "critical",
      "category": "ga4",
      "title": "GA4 parameters with PII-suggesting names",
      "description": "1 GA4 tags include parameters with names suggesting personally identifiable information…",
      "affectedItems": [
        { "id": "2", "name": "GA4 - Contact form", "piiParams": ["email"] }
      ],
      "evidence": [ /* per-tag detail */ ],
      "recommendation": "Remove PII parameters, or hash them with SHA-256 before sending…",
      "action": "Remove or hash PII data",
      "tier": "error"
    }
  ],
  "container": {
    "gtm_id": "GTM-EXAMPLE",
    "tag_count": 4,
    "from_cache": false
  }
}