Skip to main content
Glama

Count ads matched by rule

count_ad_rule_matches
Read-only

Get Ad Rule Match Count

When to use: 규칙을 저장하기 전에 그 조건이 실제로 몇 건의 광고행을 잡는지, 그리고 그 광고행을 지금 어느 규칙이 가져가고 있는지(충돌) 확인할 때. 조건이 남의 광고를 가로채는지 사전 검사하는 용도.

When NOT to use: 이미 저장된 규칙별 적용 건수는 get_ad_mapping_counts 를 쓴다. 이 tool 은 저장되지 않은 조건을 평가하는 용도다.

Limitations: 🔴 priority 경합은 반영하지 않는다 — '이 조건이 잡는 행'과 '그 행의 현재 주인'을 보여줄 뿐, 새 규칙을 특정 우선순위에 넣었을 때 실제로 무엇을 빼앗아오는지는 시뮬레이션하지 않는다. 조건 중 하나라도 값이 비었거나 지원되지 않는 연산자면 그 OR-그룹 전체가 matched_count=null 로 무효 처리된다(일부만 빼고 계산하지 않는다 — 그게 곧 과대매칭 사고이기 때문). LIKE 는 부분 문자열 매칭이라 짧은 번호 조건은 다른 제품을 삼킬 수 있다. data_management:read 권한 필요.

Examples:

  • Q: 이 조건으로 광고 규칙을 만들면 광고가 몇 건 잡히고, 지금은 어떤 규칙이 그 광고를 가져가고 있어? params: {'body': {'mapping_rule_fe': {'advancedFilters': {'subFilters': [{'conditions': [{'column': 'ad_channel_name', 'operator': 'IN', 'values': ['GOOGLE_ADS']}, {'column': 'adset_name', 'operator': 'LIKE', 'values': ['여름세일']}]}]}}}}

Output shape: object: OR-그룹별 매칭건수·현재 소유 규칙 분포 + 중복제거 총계

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "count_ad_rule_matches"
  }
}

Input Schema

NameRequiredDescriptionDefault
project-idNo
mapping_ruleNo
mapping_rule_feNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint/destructiveHint annotations, it discloses substantive behavior: priority contention is NOT simulated, an OR-group is nulled out entirely if any condition has an empty value or unsupported operator (avoiding over-matching), LIKE does substring matching that can swallow other products, and it requires data_management:read. These are real operational hazards an agent could not infer from annotations.

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?

It is front-loaded with labeled sections (When to use / When NOT / Limitations / Examples / Output shape), making it scannable. The redundant title-line heading and a fairly verbose example cost a little, but nearly every sentence carries operational value.

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 read-only evaluation tool with an output schema, the safety profile, permission requirement, null-handling semantics, and a quick output summary are all present. The remaining gap is the unexplained relationship between the two mapping_rule parameters, which matters because the agent must choose between them.

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 description coverage is 0% for three parameters, so the description must compensate, and the worked example partly does so by showing the mapping_rule_fe structure (advancedFilters > subFilters > conditions with column/operator/values). However, it never explains the distinction or precedence between the similarly named mapping_rule and mapping_rule_fe, nor what project-id does.

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 'When to use' section gives a concrete verb+resource: it counts how many ad rows an unsaved rule condition matches and reports which existing rule currently owns those rows. It explicitly distinguishes itself from get_ad_mapping_counts, which covers already-saved rules. The only weakness is the opening line, which merely restates the title before the real purpose appears.

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?

It has explicit 'When to use' and 'When NOT to use' sections, and the exclusion names the sibling get_ad_mapping_counts together with the condition that selects it (saved vs. unsaved conditions). No inference is required about which tool to pick.

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