Skip to main content
Glama

Register GA4 custom dimensions

ga_create_custom_dimension
Idempotent

Register GA4 event parameters or user properties as custom dimensions so their values are retained and usable in reports before unregistered data is discarded.

Instructions

Register event parameters (or user properties) as custom dimensions so GA4 keeps their values and reports can use them (customEvent:, customUser:). GA4 discards the values of unregistered parameters and never backfills, so register them as soon as the site starts sending them. Check ga_property_config customDimensions first: a dimension cannot be deleted through the API, only archived in the GA4 UI, and a standard property allows 50 event-scoped and 25 user-scoped. Parameters already registered with the same scope are skipped, not duplicated. dryRun shows what exists and what would be created.

Input Schema

NameRequiredDescriptionDefault
dryRunNoList existing dimensions and the ones that would be created, without creating anything.
dimensionsYesDimensions to register in this property.
propertyIdYesGA4 property ID, e.g. '123456789' (see ga_list_properties).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations (readOnlyHint=false, idempotentHint=true, destructiveHint=false): it explains that unregistered values are discarded and never backfilled, that dimensions cannot be deleted via the API (only archived in the UI), the 50 event-scoped / 25 user-scoped quota, and that duplicates are skipped rather than errored. This is exactly the operational context annotations cannot convey.

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?

Five tightly packed sentences, front-loaded with what the tool does, then constraints, then safety-net behavior. No sentence is filler — the quota, archive-only, and no-backfill facts all change how an agent would call it.

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 mutation tool with no output schema this is strong: side effects, limits, dedupe behavior, and dryRun preview are all covered. It does not describe what a successful call returns (created vs skipped counts) or any write-permission requirement, which is the only meaningful remaining gap.

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

Parameters4/5

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

Schema coverage is 100%, so the per-field docs already carry the burden; the description adds the scope-to-namespace mapping (customEvent:/customUser:) and clarifies that dryRun lists what exists plus what would be created rather than just toggling behavior. It stops short of covering the ITEM scope or the 20-item cap, so not a 5.

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?

Specific verb ('register') plus the exact resource ('event parameters or user properties as custom dimensions') and the resulting naming convention (customEvent:/customUser:). An agent can distinguish this from ga_property_config or ga_run_report without opening a schema.

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

Usage Guidelines5/5

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

Explicitly routes the agent: check ga_property_config customDimensions first, and register as soon as the site starts sending parameters because GA4 never backfills. It also states what to do about already-registered parameters (skipped) and when to use dryRun, so the when/when-not is fully covered.

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