Skip to main content
Glama

legal_put_consent

Configure the consent banner and tracking credentials for GTM, GA4, Google Ads, and Ahrefs, merging only supplied keys. Block all tracking requests until the visitor accepts.

Instructions

Configure the consent banner and every tracking credential the site uses. Merges: only the keys given change, an omitted key keeps its stored value, an empty string clears an id. Nothing is handed to the browser until the visitor accepts - this plugin owns GTM, GA4, Google Ads and Ahrefs Web Analytics precisely because it owns the gate. Search-engine verification meta tags are NOT here; those belong to cvrt-seo-manager because they fire no request. Returns { saved: true }; read the result back with legal_get_consent.

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": {
      "site": "<site>"
    },
    "name": "legal_put_consent"
  }
}

Input Schema

NameRequiredDescriptionDefault
siteYesSite id (see list_sites)
ads_idNoGoogle Ads conversion id AW-123456789 (cvrt-legal 0.10.0+). On a GA4-direct site (no GTM container) gtag configures it after Marketing consent; with a container it only documents the account (the container fires Ads) and makes the banner list Google Ads under Marketing. Empty clears it.
ga4_idNoGA4 measurement id G-XXXXXXXXXX. Without a GTM container gtag.js loads it after Statistik consent; with a container it names the property the container loads, which the banner keeps off until Statistik consent. Empty clears it.
gtm_idNoGTM container id GTM-XXXXXXX, loaded only after consent; empty clears it
enabledNoBanner on/off. Off also switches every consent gate off, so nothing tracked loads at all
backdropNoDim and block the page behind the banner until the visitor decides (default true). Never applied on the privacy, imprint or any linked legal page.
ahrefs_keyNoAhrefs Web Analytics data-key. Cookieless but still a third-party request, so it is consent-gated and must be named in the Datenschutz text before enabling. Empty clears it.
loader_urlNoOptional first-party GTM loader URL. Leave empty to load straight from googletagmanager.com (the default on all our sites)
log_enabledNoTurn the consent decision log on or off. Stays off (the default) until a 'einwilligungsnachweis' section exists in the Datenschutz document - set it only after that section is in place. Switching it rewrites a generated Datenschutz.
gtm_servicesNoWhat the GTM container fires, per category, for the banner's service list only (cvrt-legal 0.10.0+); what the container actually runs is configured in GTM. Replaces both lists as a whole: send [] to empty a category. Only shown while gtm_id is set.
imprint_pageNoPage id of the Impressum page (banner link); 0 = none
privacy_pageNoPage id of the Datenschutz page (banner link); 0 = none

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv3.14.0
    • addedInput schema / properties / ads_id
      Added value: +{
      +  "description": "Google Ads conversion id AW-123456789 (cvrt-legal 0.10.0+). On a GA4-direct site (no GTM container) gtag configures it after Marketing consent; with a container it only documents the account (the container fires Ads) and makes the banner list Google Ads under Marketing. Empty clears it.",
      +  "pattern": "^(AW-[0-9]+)?$",
      +  "type": "string"
      +}
    • changedInput schema / properties / ahrefs_key / description
      Previous value: -"Ahrefs Web Analytics data-key. Cookieless but still a third-party request, so it is consent-gated and must be named in the Datenschutz text before enabling."New value: +"Ahrefs Web Analytics data-key. Cookieless but still a third-party request, so it is consent-gated and must be named in the Datenschutz text before enabling. Empty clears it."
    • addedInput schema / properties / ahrefs_key / pattern
      Added value: +"^([A-Za-z0-9_\\/+-]+={0,2})?$"
    • addedInput schema / properties / backdrop
      Added value: +{
      +  "description": "Dim and block the page behind the banner until the visitor decides (default true). Never applied on the privacy, imprint or any linked legal page.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / enabled / description
      Added value: +"Banner on/off. Off also switches every consent gate off, so nothing tracked loads at all"
    • changedInput schema / properties / ga4_id / description
      Previous value: -"GA4 measurement id G-XXXXXXXXXX, for a site running GA4 WITHOUT a GTM container. Ignored when gtm_id is set, since loading both double-counts every hit."New value: +"GA4 measurement id G-XXXXXXXXXX. Without a GTM container gtag.js loads it after Statistik consent; with a container it names the property the container loads, which the banner keeps off until Statistik consent. Empty clears it."
    • addedInput schema / properties / ga4_id / pattern
      Added value: +"^(G-[A-Z0-9]+)?$"
    • changedInput schema / properties / gtm_id / description
      Previous value: -"GTM-XXXXXXX"New value: +"GTM container id GTM-XXXXXXX, loaded only after consent; empty clears it"
    • addedInput schema / properties / gtm_id / pattern
      Added value: +"^(GTM-[A-Z0-9]+)?$"
    • addedInput schema / properties / gtm_services
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "What the GTM container fires, per category, for the banner's service list only (cvrt-legal 0.10.0+); what the container actually runs is configured in GTM. Replaces both lists as a whole: send [] to empty a category. Only shown while gtm_id is set.",
      +  "properties": {
      +    "analytics": {
      +      "description": "Services the container fires under Statistik, e.g. [\"Microsoft Clarity\"]",
      +      "items": {
      +        "maxLength": 80,
      +        "type": "string"
      +      },
      +      "maxItems": 20,
      +      "type": "array"
      +    },
      +    "marketing": {
      +      "description": "Services the container fires under Marketing, e.g. [\"Meta Pixel\", \"LinkedIn Insight Tag\"]",
      +      "items": {
      +        "$ref": "#/properties/gtm_services/properties/analytics/items"
      +      },
      +      "maxItems": 20,
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "analytics",
      +    "marketing"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / properties / imprint_page / description
      Previous value: -"Page id of the Impressum page"New value: +"Page id of the Impressum page (banner link); 0 = none"
    • addedInput schema / properties / imprint_page / minimum
      Added value: +0
    • changedInput schema / properties / imprint_page / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / properties / log_enabled / description
      Previous value: -"Turn the consent decision log on or off. Stays off (the default) until a 'einwilligungsnachweis' section exists in the Datenschutz document - set it only after that section is in place."New value: +"Turn the consent decision log on or off. Stays off (the default) until a 'einwilligungsnachweis' section exists in the Datenschutz document - set it only after that section is in place. Switching it rewrites a generated Datenschutz."
    • changedInput schema / properties / privacy_page / description
      Previous value: -"Page id of the Datenschutz page"New value: +"Page id of the Datenschutz page (banner link); 0 = none"
    • addedInput schema / properties / privacy_page / minimum
      Added value: +0
    • changedInput schema / properties / privacy_page / type
      Previous value: -"number"New value: +"integer"
    • changedInput schema / required
      Previous value: -[
      -  "site",
      -  "enabled"
      -]New value: +[
      +  "site"
      +]
  2. Addedv3.4.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely delivers: it discloses merge semantics ('only the keys given change, an omitted key keeps its stored value, an empty string clears an id'), the gating behavior ('Nothing is handed to the browser until the visitor accepts'), that 'enabled: off' switches every gate off, that backdrop is suppressed on legal pages, that log_enabled rewrites a generated Datenschutz, and the return shape. It omits permission/auth requirements and whether the change takes effect on already-published pages, which keeps it from a 5.

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?

Front-loaded with the core action and the merge rule, and nearly every clause carries information (gating rationale, exclusion, read-back pointer). It is dense and prose-heavy for a tool description, with the GTM/GA4 ownership justification bordering on editorial, but nothing is filler.

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?

For a 12-parameter tool with a nested object and no output schema, the description supplies merge semantics, the return value ({ saved: true }), a read-back instruction, and gate side effects. Remaining gaps are prerequisites: required scopes, whether changes go live immediately, and what happens when gtm_services is sent without gtm_id.

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?

Schema description coverage is 100% and the per-parameter descriptions are unusually detailed, so the schema is already doing the heavy lifting and the baseline is 3. The description does add one cross-parameter behavior the schema cannot express (whole-object merge semantics), but it does not restate or clarify individual field meaning beyond that.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Configure the consent banner and every tracking credential the site uses'), then explicitly carves out what it does NOT cover: 'Search-engine verification meta tags are NOT here; those belong to cvrt-seo-manager because they fire no request.' It also names legal_get_consent as the read-back path, so an agent can distinguish this from its sibling without opening either schema.

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

Usage Guidelines4/5

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

Gives concrete conditional guidance: set log_enabled only after an 'einwilligungsnachweis' section exists, gtm_services is 'Only shown while gtm_id is set', and use legal_get_consent to read the result back. Covers a conditional prerequisite and two exclusions, but does not state when to prefer this over siblings like legal_put_generator or legal_put_theme in broad terms.

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

Deploy Server

Other Tools