Skip to main content
Glama
Samarth GTM MCP Server

Samarth GTM MCP Server

Official

templates_describe_fields

Read a custom or gallery GTM template's real field definitions—parameter keys, widget types, labels, required flags, options, and tagType—before creating tags, so you avoid guessed parameters.

Instructions

Read the FIELDS a custom or Community Gallery template accepts, straight from the template's own source. Call this after templates_import_from_gallery and BEFORE tags_create, so the tag is built with that template's real parameter keys instead of guessed ones. Returns each field's name (the key for the tag's parameter array), its widget type, its label, whether it is required, and any fixed options. Also returns the template's tagType, so one call gives everything tags_create needs. Read-only. Only works for custom and gallery templates: GTM's ~68 BUILT-IN vendor templates carry no source, so for those use tags_type_profile against a container that already has one.

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": {
      "accountId": "<accountId>",
      "containerId": "<containerId>",
      "workspaceId": "<workspaceId>",
      "templateId": "<templateId>"
    },
    "name": "templates_describe_fields"
  }
}

Input Schema

NameRequiredDescriptionDefault
accountIdYesThe GTM account ID.
templateIdYesThe template ID, from templates_list.
containerIdYesThe GTM container ID.
workspaceIdYesThe GTM workspace ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.497.5

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares the operation read-only, enumerates exactly what is returned (field name, widget type, label, required flag, fixed options, plus tagType), and discloses the hard limitation that built-in vendor templates have no source so the call will not work for them.

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, then sequencing, then return contents, then the built-in caveat — a sensible order with no filler sentences. It is on the dense side, and "straight from the template's own source" partially overlaps with the later built-in limitation, but nothing is expendable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a four-ID read tool with no output schema, the description supplies the return contents, the read-only nature, the workflow position, and the failure boundary for built-in templates. An agent has everything needed to decide to call it and to interpret the result.

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 four required IDs are already documented, so the baseline applies. The description adds no syntax or format detail for accountId/containerId/workspaceId/templateId; its added value is about output shape (field name as the key for the tag's parameter array) rather than the inputs.

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 ("Read the FIELDS a custom or Community Gallery template accepts") and narrows scope to custom/gallery templates as opposed to built-ins. An agent can distinguish it from templates_get or tags_type_profile without opening any 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?

Gives explicit ordering ("after templates_import_from_gallery and BEFORE tags_create") and names the reason for that placement. It also names the alternative for the excluded case: GTM built-in vendor templates have no source, so use tags_type_profile instead. Both the when and the when-not are covered.

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