[{"data":1,"prerenderedAt":1020},["ShallowReactive",2],{"docs-\u002Fmcp\u002Ftools\u002Fevaluate-rule\u002F":3},{"id":4,"title":5,"body":6,"breadcrumb":978,"coderail":985,"dateModified":1005,"datePublished":1005,"description":1006,"extension":1007,"meta":1008,"navigation":1009,"next":1010,"path":1011,"prev":1012,"schemaType":1015,"seo":1016,"stem":1017,"wide":1018,"__hash__":1019},"docs\u002Fmcp\u002Ftools\u002Fevaluate-rule.md","evaluate_rule",{"type":7,"value":8,"toc":970},"minimark",[9,16,64,71,75,80,86,136,140,251,269,278,282,285,377,417,439,817,830,834,900,904,907,929,932,940,944,966],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,29,35,52,58],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"tool"," — ",[27,28,5],"code",{},[20,30,31,34],{},[13,32,33],{},"purpose"," — run one rule against a container; return the full finding",[20,36,37,25,40,43,44,47,48,51],{},[13,38,39],{},"rest equivalent",[27,41,42],{},"POST \u002Fv1\u002Fevaluate-rule"," (the REST response also carries ",[27,45,46],{},"evaluated_at"," and ",[27,49,50],{},"duration_ms",")",[20,53,54,57],{},[13,55,56],{},"rate limit"," — 500\u002Fday per user",[20,59,60,63],{},[13,61,62],{},"synchronous"," — yes",[10,65,66,67,70],{},"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 ",[27,68,69],{},"scan_url",", or to confirm a fix after a container change.",[72,73],"endpoint-bar",{"method":74,"path":5},"TOOL",[76,77,79],"h2",{"id":78},"when","When to use it",[10,81,82,83,85],{},"Use ",[27,84,5],{}," when you already know which rule you care about.",[17,87,88,115],{},[20,89,90,25,95,97,98,100,101,104,105,108,109,111,112,114],{},[13,91,92,93],{},"vs ",[27,94,69],{},[27,96,69],{}," runs all rules and returns thin findings: the first 3 affected items and no evidence. ",[27,99,5],{}," runs one rule and returns the complete ",[27,102,103],{},"affectedItems"," list and the ",[27,106,107],{},"evidence",". Start with ",[27,110,69],{},", then call ",[27,113,5],{}," on the finding you want to look at.",[20,116,117,125,126,128,129,132,133,135],{},[13,118,92,119,47,122],{},[27,120,121],{},"list_rules",[27,123,124],{},"get_rule"," — those read rule metadata and never touch a container. ",[27,127,5],{}," runs the rule. To find the right ",[27,130,131],{},"rule_id",", call ",[27,134,121],{}," first.",[76,137,139],{"id":138},"arguments","Arguments",[141,142,143,162],"table",{},[144,145,146],"thead",{},[147,148,149,153,156,159],"tr",{},[150,151,152],"th",{},"Argument",[150,154,155],{},"Type",[150,157,158],{},"Required",[150,160,161],{},"Description",[163,164,165,188,219,236],"tbody",{},[147,166,167,172,175,178],{},[168,169,170],"td",{},[27,171,131],{},[168,173,174],{},"string",[168,176,177],{},"required",[168,179,180,181,184,185,187],{},"Rule ID to run (for example ",[27,182,183],{},"ga4-pii-parameter-names","). Use ",[27,186,121],{}," to find IDs.",[147,189,190,195,197,200],{},[168,191,192],{},[27,193,194],{},"url",[168,196,174],{},[168,198,199],{},"one of",[168,201,202,203,206,207,210,211,214,215,218],{},"Address of the page whose container to check. A full URL (",[27,204,205],{},"https:\u002F\u002Fexample.com","), a bare domain (",[27,208,209],{},"example.com",", scanned over ",[27,212,213],{},"https","), or a GTM ID (",[27,216,217],{},"GTM-XXXXX",") are all accepted. The tool's own schema says \"Full URL\"; the other two forms work as well.",[147,220,221,226,228,230],{},[168,222,223],{},[27,224,225],{},"gtm_id",[168,227,174],{},[168,229,199],{},[168,231,232,233,235],{},"GTM container ID (",[27,234,217],{},", upper case). The page is not fetched.",[147,237,238,243,246,248],{},[168,239,240],{},[27,241,242],{},"data",[168,244,245],{},"object",[168,247,199],{},[168,249,250],{},"A GTM JSON export as downloaded from GTM, or container data already parsed by TagManifest. Nothing is fetched.",[10,252,253,254,256,257,259,260,262,263,265,266,268],{},"One of ",[27,255,194],{},", ",[27,258,225],{},", or ",[27,261,242],{}," is needed alongside ",[27,264,131],{},". If ",[27,267,242],{}," is present it is used and the other two are ignored.",[270,271,272],"callout",{},[10,273,274,277],{},[13,275,276],{},"Synchronous."," The tool returns when the rule has run. No polling, no webhooks. A fetched container is reused for up to five minutes.",[76,279,281],{"id":280},"returns","Returns",[10,283,284],{},"The tool result is one text block. Its text is a JSON object:",[141,286,287,297],{},[144,288,289],{},[147,290,291,294],{},[150,292,293],{},"Field",[150,295,296],{},"Meaning",[163,298,299,308,321,335,345],{},[147,300,301,305],{},[168,302,303],{},[27,304,131],{},[168,306,307],{},"The rule that ran.",[147,309,310,315],{},[168,311,312],{},[27,313,314],{},"fired",[168,316,317,320],{},[27,318,319],{},"true"," when the rule produced at least one finding.",[147,322,323,328],{},[168,324,325],{},[27,326,327],{},"finding_count",[168,329,330,331,334],{},"The number of findings. ",[27,332,333],{},"0"," when the rule did not fire.",[147,336,337,342],{},[168,338,339],{},[27,340,341],{},"findings",[168,343,344],{},"The findings, as the rule engine produced them. Empty when the rule did not fire.",[147,346,347,352],{},[168,348,349],{},[27,350,351],{},"container",[168,353,354,256,356,359,360,363,364,366,367,369,370,372,373,376],{},[27,355,225],{},[27,357,358],{},"tag_count",", and ",[27,361,362],{},"from_cache",". ",[27,365,225],{}," is read from the container. When a parsed container in ",[27,368,242],{}," carries no ID, a ",[27,371,225],{}," passed in the same call is used; with neither, it is ",[27,374,375],{},"null",".",[10,378,379,380,382,383,256,386,256,389,256,392,256,395,256,398,256,400,256,402,256,405,256,408,363,411,413,414,416],{},"Findings here are not the thin findings that ",[27,381,69],{}," returns. The field names are the rule engine's own, in camelCase: ",[27,384,385],{},"ruleId",[27,387,388],{},"severity",[27,390,391],{},"category",[27,393,394],{},"title",[27,396,397],{},"description",[27,399,103],{},[27,401,107],{},[27,403,404],{},"recommendation",[27,406,407],{},"action",[27,409,410],{},"tier",[27,412,103],{}," holds the affected items the rule reports (some rules list only the first 10 or 20). The shape of each affected item and of ",[27,415,107],{}," depends on the rule.",[10,418,419,422,423,426,427,429,430,433,434,436,437,376],{},[13,420,421],{},"Caching."," On MCP the cache field is ",[27,424,425],{},"container.from_cache",". It is ",[27,428,319],{}," when a stored copy of the container was used, ",[27,431,432],{},"false"," when the container was fetched from Google, and ",[27,435,375],{}," when the container came from ",[27,438,242],{},[440,441,443],"details",{"summary":442},"Full response shape",[444,445,450],"pre",{"className":446,"code":447,"language":448,"meta":449,"style":449},"language-json shiki shiki-themes github-light github-dark","{\n  \"rule_id\": \"ga4-pii-parameter-names\",\n  \"fired\": true,\n  \"finding_count\": 1,\n  \"findings\": [\n    {\n      \"ruleId\": \"ga4-pii-parameter-names\",\n      \"severity\": \"critical\",\n      \"category\": \"ga4\",\n      \"title\": \"GA4 parameters with PII-suggesting names\",\n      \"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.\",\n      \"affectedItems\": [\n        { \"id\": \"2\", \"name\": \"GA4 - Contact form\", \"piiParams\": [\"email\"] }\n      ],\n      \"evidence\": [\n        {\n          \"tagId\": \"2\",\n          \"params\": [\n            { \"name\": \"email\", \"value\": \"jane@example.com...\" }\n          ]\n        }\n      ],\n      \"recommendation\": \"Remove PII parameters, or hash them with SHA-256 before sending. Ensure any user-provided data sent to GA4 is properly anonymized.\",\n      \"action\": \"Remove or hash PII data\",\n      \"tier\": \"error\"\n    }\n  ],\n  \"container\": {\n    \"gtm_id\": \"GTM-EXAMPLE\",\n    \"tag_count\": 4,\n    \"from_cache\": false\n  }\n}\n","json","",[27,451,452,461,478,490,503,512,518,530,543,556,569,582,590,628,634,642,648,660,668,693,699,705,710,723,736,747,753,759,768,781,794,805,811],{"__ignoreMap":449},[453,454,457],"span",{"class":455,"line":456},"line",1,[453,458,460],{"class":459},"sVt8B","{\n",[453,462,464,468,471,475],{"class":455,"line":463},2,[453,465,467],{"class":466},"sj4cs","  \"rule_id\"",[453,469,470],{"class":459},": ",[453,472,474],{"class":473},"sZZnC","\"ga4-pii-parameter-names\"",[453,476,477],{"class":459},",\n",[453,479,481,484,486,488],{"class":455,"line":480},3,[453,482,483],{"class":466},"  \"fired\"",[453,485,470],{"class":459},[453,487,319],{"class":466},[453,489,477],{"class":459},[453,491,493,496,498,501],{"class":455,"line":492},4,[453,494,495],{"class":466},"  \"finding_count\"",[453,497,470],{"class":459},[453,499,500],{"class":466},"1",[453,502,477],{"class":459},[453,504,506,509],{"class":455,"line":505},5,[453,507,508],{"class":466},"  \"findings\"",[453,510,511],{"class":459},": [\n",[453,513,515],{"class":455,"line":514},6,[453,516,517],{"class":459},"    {\n",[453,519,521,524,526,528],{"class":455,"line":520},7,[453,522,523],{"class":466},"      \"ruleId\"",[453,525,470],{"class":459},[453,527,474],{"class":473},[453,529,477],{"class":459},[453,531,533,536,538,541],{"class":455,"line":532},8,[453,534,535],{"class":466},"      \"severity\"",[453,537,470],{"class":459},[453,539,540],{"class":473},"\"critical\"",[453,542,477],{"class":459},[453,544,546,549,551,554],{"class":455,"line":545},9,[453,547,548],{"class":466},"      \"category\"",[453,550,470],{"class":459},[453,552,553],{"class":473},"\"ga4\"",[453,555,477],{"class":459},[453,557,559,562,564,567],{"class":455,"line":558},10,[453,560,561],{"class":466},"      \"title\"",[453,563,470],{"class":459},[453,565,566],{"class":473},"\"GA4 parameters with PII-suggesting names\"",[453,568,477],{"class":459},[453,570,572,575,577,580],{"class":455,"line":571},11,[453,573,574],{"class":466},"      \"description\"",[453,576,470],{"class":459},[453,578,579],{"class":473},"\"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.\"",[453,581,477],{"class":459},[453,583,585,588],{"class":455,"line":584},12,[453,586,587],{"class":466},"      \"affectedItems\"",[453,589,511],{"class":459},[453,591,593,596,599,601,604,606,609,611,614,616,619,622,625],{"class":455,"line":592},13,[453,594,595],{"class":459},"        { ",[453,597,598],{"class":466},"\"id\"",[453,600,470],{"class":459},[453,602,603],{"class":473},"\"2\"",[453,605,256],{"class":459},[453,607,608],{"class":466},"\"name\"",[453,610,470],{"class":459},[453,612,613],{"class":473},"\"GA4 - Contact form\"",[453,615,256],{"class":459},[453,617,618],{"class":466},"\"piiParams\"",[453,620,621],{"class":459},": [",[453,623,624],{"class":473},"\"email\"",[453,626,627],{"class":459},"] }\n",[453,629,631],{"class":455,"line":630},14,[453,632,633],{"class":459},"      ],\n",[453,635,637,640],{"class":455,"line":636},15,[453,638,639],{"class":466},"      \"evidence\"",[453,641,511],{"class":459},[453,643,645],{"class":455,"line":644},16,[453,646,647],{"class":459},"        {\n",[453,649,651,654,656,658],{"class":455,"line":650},17,[453,652,653],{"class":466},"          \"tagId\"",[453,655,470],{"class":459},[453,657,603],{"class":473},[453,659,477],{"class":459},[453,661,663,666],{"class":455,"line":662},18,[453,664,665],{"class":466},"          \"params\"",[453,667,511],{"class":459},[453,669,671,674,676,678,680,682,685,687,690],{"class":455,"line":670},19,[453,672,673],{"class":459},"            { ",[453,675,608],{"class":466},[453,677,470],{"class":459},[453,679,624],{"class":473},[453,681,256],{"class":459},[453,683,684],{"class":466},"\"value\"",[453,686,470],{"class":459},[453,688,689],{"class":473},"\"jane@example.com...\"",[453,691,692],{"class":459}," }\n",[453,694,696],{"class":455,"line":695},20,[453,697,698],{"class":459},"          ]\n",[453,700,702],{"class":455,"line":701},21,[453,703,704],{"class":459},"        }\n",[453,706,708],{"class":455,"line":707},22,[453,709,633],{"class":459},[453,711,713,716,718,721],{"class":455,"line":712},23,[453,714,715],{"class":466},"      \"recommendation\"",[453,717,470],{"class":459},[453,719,720],{"class":473},"\"Remove PII parameters, or hash them with SHA-256 before sending. Ensure any user-provided data sent to GA4 is properly anonymized.\"",[453,722,477],{"class":459},[453,724,726,729,731,734],{"class":455,"line":725},24,[453,727,728],{"class":466},"      \"action\"",[453,730,470],{"class":459},[453,732,733],{"class":473},"\"Remove or hash PII data\"",[453,735,477],{"class":459},[453,737,739,742,744],{"class":455,"line":738},25,[453,740,741],{"class":466},"      \"tier\"",[453,743,470],{"class":459},[453,745,746],{"class":473},"\"error\"\n",[453,748,750],{"class":455,"line":749},26,[453,751,752],{"class":459},"    }\n",[453,754,756],{"class":455,"line":755},27,[453,757,758],{"class":459},"  ],\n",[453,760,762,765],{"class":455,"line":761},28,[453,763,764],{"class":466},"  \"container\"",[453,766,767],{"class":459},": {\n",[453,769,771,774,776,779],{"class":455,"line":770},29,[453,772,773],{"class":466},"    \"gtm_id\"",[453,775,470],{"class":459},[453,777,778],{"class":473},"\"GTM-EXAMPLE\"",[453,780,477],{"class":459},[453,782,784,787,789,792],{"class":455,"line":783},30,[453,785,786],{"class":466},"    \"tag_count\"",[453,788,470],{"class":459},[453,790,791],{"class":466},"4",[453,793,477],{"class":459},[453,795,797,800,802],{"class":455,"line":796},31,[453,798,799],{"class":466},"    \"from_cache\"",[453,801,470],{"class":459},[453,803,804],{"class":466},"false\n",[453,806,808],{"class":455,"line":807},32,[453,809,810],{"class":459},"  }\n",[453,812,814],{"class":455,"line":813},33,[453,815,816],{"class":459},"}\n",[10,818,819,820,256,823,826,827,829],{},"When the rule does not fire, the result is ",[27,821,822],{},"\"fired\": false",[27,824,825],{},"\"finding_count\": 0"," and an empty ",[27,828,341],{}," list.",[76,831,833],{"id":832},"errors","Errors",[17,835,836,857,882],{},[20,837,838,841,842,845,846,848,849,256,851,47,853,856],{},[13,839,840],{},"Bad arguments"," come back as a JSON-RPC error with code ",[27,843,844],{},"-32602",". This covers a missing ",[27,847,131],{},", an argument the tool does not accept (the message suggests the nearest name), and an argument of the wrong type. ",[27,850,391],{},[27,852,410],{},[27,854,855],{},"top_n"," are not arguments of this tool. These are checked before the rate limit, so they do not count against it.",[20,858,859,862,863,866,867,869,870,873,874,256,876,878,879,881],{},[13,860,861],{},"A run that fails"," comes back as a normal tool result with ",[27,864,865],{},"isError: true"," and a plain message in the text block. Examples: a ",[27,868,131],{}," that does not exist (",[27,871,872],{},"Unknown rule_id: …","), none of ",[27,875,194],{},[27,877,225],{}," or ",[27,880,242],{}," 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.",[20,883,884,887,888,891,892,895,896,899],{},[13,885,886],{},"Rate limit"," comes back as a JSON-RPC error with code ",[27,889,890],{},"-32603"," and the message ",[27,893,894],{},"Rate limit exceeded for evaluate_rule: 501\u002F500. Resets at \u003Ctime>."," The HTTP status is 200. MCP responses carry no ",[27,897,898],{},"X-RateLimit-*"," headers. The limit resets at midnight UTC.",[76,901,903],{"id":902},"try-saying","Try saying",[10,905,906],{},"Natural-language prompts that route to this tool through an agent:",[17,908,909,915,922],{},[20,910,911,912,914],{},"\"Check rule ",[27,913,183],{}," against example.com. Did it fire?\"",[20,916,917,918,921],{},"\"I added a Conversion Linker. Re-run ",[27,919,920],{},"missing-conversion-linker"," on GTM-XXXXX and tell me if it still flags.\"",[20,923,924,925,928],{},"\"Show me every tag that ",[27,926,927],{},"eval-usage"," flags in this export.\"",[10,930,931],{},"For agents wired to your own application:",[444,933,938],{"className":934,"code":936,"language":937},[935],"language-text","You have access to TagManifest's MCP server. Use the evaluate_rule\ntool to run a single audit rule against a GTM container and return\nthe complete finding. The tool requires a rule_id plus one of url,\ngtm_id, or data. It returns fired (boolean), finding_count, the full\nfindings array with all affectedItems, and a container summary.\n","text",[27,939,936],{"__ignoreMap":449},[76,941,943],{"id":942},"see-also","See also",[17,945,946,953,959],{},[20,947,948,952],{},[949,950,69],"a",{"href":951},"\u002Fmcp\u002Ftools\u002Fscan-url\u002F"," — run all rules against a container; returns thin findings",[20,954,955,958],{},[949,956,121],{"href":957},"\u002Fmcp\u002Ftools\u002Flist-rules\u002F"," — browse the rule catalog to find rule IDs",[20,960,961,965],{},[949,962,964],{"href":963},"\u002Fhealth-score\u002F","Health score"," — how rule findings combine into the container score",[967,968,969],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":449,"searchDepth":463,"depth":463,"links":971},[972,973,974,975,976,977],{"id":78,"depth":463,"text":79},{"id":138,"depth":463,"text":139},{"id":280,"depth":463,"text":281},{"id":832,"depth":463,"text":833},{"id":902,"depth":463,"text":903},{"id":942,"depth":463,"text":943},[979,982,984],{"label":980,"href":981},"API Reference","\u002F",{"label":983},"MCP tools",{"label":5},{"cards":986,"onpage":999},[987,992],{"title":988,"tabs":989},"MCP tool call",[990],{"label":138,"language":448,"code":991},"{\n  \"tool\": \"evaluate_rule\",\n  \"arguments\": {\n    \"rule_id\": \"ga4-pii-parameter-names\",\n    \"url\": \"https:\u002F\u002Fexample.com\"\n  }\n}\n",{"title":993,"variant":994,"tabs":995},"Tool result","response",[996],{"label":997,"language":448,"code":998},"tool result","{\n  \"rule_id\": \"ga4-pii-parameter-names\",\n  \"fired\": true,\n  \"finding_count\": 1,\n  \"findings\": [\n    {\n      \"ruleId\": \"ga4-pii-parameter-names\",\n      \"severity\": \"critical\",\n      \"category\": \"ga4\",\n      \"title\": \"GA4 parameters with PII-suggesting names\",\n      \"description\": \"1 GA4 tags include parameters with names suggesting personally identifiable information…\",\n      \"affectedItems\": [\n        { \"id\": \"2\", \"name\": \"GA4 - Contact form\", \"piiParams\": [\"email\"] }\n      ],\n      \"evidence\": [ \u002F* per-tag detail *\u002F ],\n      \"recommendation\": \"Remove PII parameters, or hash them with SHA-256 before sending…\",\n      \"action\": \"Remove or hash PII data\",\n      \"tier\": \"error\"\n    }\n  ],\n  \"container\": {\n    \"gtm_id\": \"GTM-EXAMPLE\",\n    \"tag_count\": 4,\n    \"from_cache\": false\n  }\n}\n",[1000,1001,1002,1003,1004],{"id":78,"label":79},{"id":138,"label":139},{"id":280,"label":281},{"id":832,"label":833},{"id":902,"label":903},null,"MCP tool that runs a single rule against a container and returns the full finding, with every affected item.","md",{},true,{"href":957,"title":121},"\u002Fmcp\u002Ftools\u002Fevaluate-rule",{"href":1013,"title":1014},"\u002Fmcp\u002Ftools\u002Fscan-container\u002F","scan_container","APIReference",{"title":5,"description":1006},"mcp\u002Ftools\u002Fevaluate-rule",false,"3XE-h6VbUucLdToLE18lJNRZbrNHV2ZSKOnllEiEgko",1796069482700]