Skip to main content
Glama

AdsAgent — TikTok Ads MCP

Preview a template from an ad group

templates_reverse_engineer
Read-only

Reverse-engineer a template preview from one live TikTok adgroup. Fans out /campaign/get/ + /adgroup/get/ + /ad/get/ and returns an unsaved preview plus a signed source_receipt. Review the preview, then pass its extracted fields and source_receipt unchanged to templates_create before expiry. Mirrors Meta templates_reverse_engineer (Meta adset_id == TikTok adgroup_id — adset is the MCP wire name for what TikTok calls adgroup; either spelling is accepted). Image music is retained only when every actual image variant uses one unambiguous track. Video cover images and Spark post previews do not supply reusable image music. Conflicting or missing source tracks are omitted for target-specific selection.

REQUIRED: advertiser_id (str — TikTok advertiser_id this user owns), adgroup_id OR adset_id (str — TikTok adgroup_id; both names work). EXAMPLE: templates_reverse_engineer({"advertiser_id": "7390000000000000000", "adset_id": "1820000000000000000"})

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
adset_idNo
adgroup_idNo
advertiser_idYes
connection_contextNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / connection_context
      Added value: +{
      +  "pattern": "^mctx_v1_[0-9a-f]{64}$",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false, so the safety profile is covered. The description still adds substantial behavior beyond that: the three fan-out endpoints, the fact the preview is unsaved, the signed source_receipt and its expiry, and the nuanced image-music retention/omission rules. A 4 rather than 5 because expiry timing is not quantified.

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-loads purpose and the create-handoff, then packs required params and an example. The image-music retention detail is verbose but relevant to correctness. Dense yet well-ordered; not padded.

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?

There is no output schema, so the description must describe returns — it does (unsaved preview plus signed source_receipt), and it covers the critical handoff constraint and naming aliases. Nothing an agent needs to call and chain this tool is missing.

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 0%, so the description must carry the load. It documents advertiser_id and the adgroup_id/adset_id alias with types and the Meta-vs-TikTok naming rationale, adding real meaning. It leaves connection_context undocumented, which is a gap for a fully compensating description.

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+resource ('reverse-engineer a template preview from one live TikTok adgroup') and explains the mechanism (fans out /campaign/get/, /adgroup/get/, /ad/get/). It clearly distinguishes itself from templates_create by positioning itself as the preceding preview step, so an agent can route correctly.

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 an explicit workflow: review the preview, then pass its extracted fields and source_receipt unchanged to templates_create before expiry. This is a concrete when-to-use and next-step instruction, not just implied context.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources