Skip to main content
Glama

Update ad product matches

update_ad_relation
Destructive

Update Ad Relation

When to use: 광고 소재↔상품 연결(relation)을 직접 고쳐 저장할 때. 규칙으로 잡히지 않는 건을 사람이 수동 지정하거나 오귀속을 바로잡는 용도.

When NOT to use: 연결을 끊는 것은 delete_ad_relation 이다. 규칙 자체를 고쳐 여러 건을 한꺼번에 바꾸려면 광고 매칭 규칙 도구(create_ad_mapping_rule·update_ad_rule_mapping)를 쓴다. 현재 연결 상태 조회는 search_ad_relations.

Limitations: body 는 AdRelationSchema 리스트다 — 소재 식별 필드(ad_channel_name·ad_account_id·ad_account_name·campaign_id·campaign_name·adset_id·adset_name·ad_id·ad_name·landing_url)에 더해 연결 대상을 mapped_product 중첩 리스트로 넘긴다(평면 product_id 필드가 아니다). 소재 단위 overwrite — 위 식별 필드 전체가 일치하는 기존 행을 지우고 body 내용으로 다시 넣는다(부분 필드 병합이 아니다). 그래서 대상 행은 search_ad_relations 로 먼저 조회해 식별 필드를 그대로 복사해 넘겨야 한다 — 하나라도 다르면 기존 행이 지워지지 않고 새 행이 생긴다. mapped_product 를 빈 리스트로 주면 그 소재의 연결이 해제된다. body 가 빈 리스트면 400. data_management:write 권한 + AD_MAPPING 스코프 필요. ad_relation 스코프 감사 이벤트로 기록되므로 사후 복원이 가능하다.

Examples:

  • Q: 이 광고 소재를 '수분크림 50ml' 상품에 직접 연결해줘 params: {'body': [{'ad_channel_name': 'GOOGLE', 'ad_account_id': 'acc-1', 'ad_account_name': '메인 광고계정', 'campaign_id': 'c-1', 'campaign_name': '여름세일', 'adset_id': 'as-1', 'adset_name': '관심사타겟', 'ad_id': 'ad-1', 'ad_name': '여름세일_배너A', 'landing_url': 'https://shop.example.com/p/1001', 'mapped_product': [{'product_id': '1001', 'product_name': '수분크림 50ml', 'brand_name': '브랜드A', 'channel_name': '스마트스토어', 'shop_id': 1, 'shop_name': '브랜드A 스토어'}]}]}

Output shape: no content (성공 시 body 없음)

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": {
      "body": "<body>"
    },
    "name": "update_ad_relation"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYes
project-idNo
auth_methodNojwt

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds genuinely new behavioral context: per-ad-unit overwrite (rows matching all identity fields are deleted and re-inserted, no partial merge), empty mapped_product unlinks, empty body returns 400, and the required data_management:write permission plus AD_MAPPING scope and the ad_relation audit event for later recovery. The one gap is that relation_provider defaults (MANUAL) and project-id/auth_method behavior are never mentioned.

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?

Strongly front-loaded with labeled When to use / When NOT to use / Limitations / Examples sections, so an agent can stop reading at any tier. The redundant 'Update Ad Relation' heading and a verbose worked example cost a little, but nearly every sentence carries decision-relevant information.

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 destructive overwrite tool with no output schema, the definition covers mutation semantics, error behavior, permissions, and even states the return shape (no content on success). What is missing is the meaning of the optional project-id/auth_method parameters and the relation_provider defaults, which leaves a small but real hole.

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 the load; it explains the body list shape, enumerates the identity fields, and stresses that mapped_product is a nested list rather than a flat product_id — a real semantic addition. However it says nothing about project-id, auth_method, or the relation_provider/relation_provider_type defaults present in the schema, so it only partly compensates.

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?

The 'When to use' section states a specific verb and resource in concrete terms — hand-correcting and saving ad-creative↔product relations that rule-based matching misses — and explicitly separates this tool from delete_ad_relation, create_ad_mapping_rule/update_ad_rule_mapping, and search_ad_relations. An agent can distinguish this tool from every relevant sibling without opening another 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?

Both directions are explicit: use it when a rule doesn't catch the case or when fixing a mis-attribution, and do NOT use it for unlinking (delete_ad_relation), for bulk rule changes (the rule tools), or for reading current state (search_ad_relations). Alternatives are named with the condition that selects each.

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