Skip to main content
Glama

Get variable

gtm_get_variable
Read-onlyIdempotent

Retrieve a Google Tag Manager variable by container and variable ID, including flattened parameters and fingerprint, optionally from a specific workspace.

Instructions

Full variable with flattened parameters (e.g. Data Layer name, JS code) and fingerprint. Container as public id (GTM-XXXXXXX, or a linked G-/AW- destination id) or API path accounts//containers/. Workspace id (numeric). Omit to use the 'Default Workspace' (looked up once and cached).

Input Schema

NameRequiredDescriptionDefault
containerYes
variable_idYes
workspace_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already establish read-only, idempotent, non-destructive, open-world behavior. The description adds meaningful context beyond that: container can be a public id, a linked G-/AW- destination id, or an API path, and omitting workspace_id triggers a cached Default Workspace lookup. It does not cover error behavior or variable_id format, but it is substantially more informative than the annotations alone.

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?

The description is compact and front-loads the returned payload, then moves through container format and workspace default. Parenthetical examples are efficient, though the opening would read more naturally if it began with the action rather than the result.

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?

An output schema exists, so return-value explanation is unnecessary, and annotations cover the safety profile. The description supplies the container addressing formats and workspace omission behavior that an agent needs to invoke the tool correctly; only the variable_id format is left unaddressed.

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 0%, so the description must carry parameter meaning. It documents container formats in useful detail and explains the workspace_id default-with-caching behavior, but variable_id is left entirely unexplained beyond its name. Two of three parameters are well served, which is adequate but incomplete for a zero-coverage schema.

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 that it returns a full variable with flattened parameters and fingerprint, which is a specific resource and payload shape. It distinguishes itself from gtm_list_variables implicitly, but the core action verb (retrieve a single variable by id) is only implied by the tool name rather than stated outright.

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?

Usage is implied by the required container and variable_id parameters and by the contrast with list-style siblings, but the description never explicitly says when to use this tool versus gtm_list_variables or gtm_get_container. It does provide useful guidance on optional workspace_id behavior, which slightly exceeds pure implication.

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