negative-keyword-sweep

negative-keyword-sweep is a command for coding agents from markifact/markifact-mcp. It costs 50 tokens per session (1,534 once invoked), scanned A, original, MIT.

A Google Ads cleanup command that finds search terms spending money without useful results and adds them as negative keywords.

In plain words
What is it for?
It helps review search-term reports, identify non-converting or off-target searches, group related problems, and add phrase or broad negative keywords.
Why use it?
It reduces wasted advertising spend while choosing whether exclusions should apply to an account, campaign, or ad group.

Command

Part of the markifact plugin — 2 skills, 7 commands, 1 agent, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/markifact/markifact-mcp/negative-keyword-sweep
Clone the repo
git clone --depth 1 https://github.com/markifact/markifact-mcp

Or install markifact, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 1 agent, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for negative-keyword-sweep

README.md
[![agentmods](https://agentmods.dev/badge/commands/markifact/markifact-mcp/negative-keyword-sweep.svg)](https://agentmods.dev/commands/markifact/markifact-mcp/negative-keyword-sweep)
Your own site
<a href="https://agentmods.dev/commands/markifact/markifact-mcp/negative-keyword-sweep"><img src="https://agentmods.dev/badge/commands/markifact/markifact-mcp/negative-keyword-sweep.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,534 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.01534
Opus 5 $0.00025 $0.00767
Sonnet 5 $0.00010 $0.00307
Haiku 4.5 $0.00005 $0.00153

Measured 5d ago against content hash 4a761fc0c384, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

negative-keyword-sweep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/negative-keyword-sweep.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Goal

Pull the search-terms report, identify spend that isn't producing, group it intelligently, and add negatives at the right level — without nuking legitimate intent.

Inputs to confirm (batch)

  1. Account name (substring) — required.
  2. Scope — single campaign, list of campaigns, or "all Search campaigns" — required.
  3. Lookback — default 30 days; user can override (60 / 90).
  4. Waste thresholds — defaults; allow override:
    • No-converter: spend ≥ $X over lookback AND 0 conversions. Default $X = 2× target CPA, or $50 if no target.
    • Low-CVR offender: spend ≥ 3× target CPA AND CVR < 25% of account CVR.
    • Off-brand / off-intent: terms that match a denylist of words (e.g. free, jobs, careers, tutorial, review, salary, download, cheap, pirate, crack) — calibrated to vertical.
  5. Negative scope preference — default behavior:
    • Recurring junk seen across multiple campaigns → account-level shared negative list.
    • Waste seen only in one campaign → campaign-level.
    • Single-theme misintent (e.g. "free" only hurts a paid product ad group) → ad-group-level.
    • Default match type: phrase, except for single-word obvious junk → broad isn't an option (negatives have no broad), so use exact for single tokens like free.

Workflow

  1. Discover ops: gads_select_accounts, gads_list_report_fields, gads_get_report, gads_create_negative_keyword_list, gads_attach_negative_list_to_campaigns, gads_add_keywords_to_negative_list, gads_add_negative_keywords_to_campaigns, gads_add_negative_keywords_to_ad_groups.
  2. Inspect every op via get_operation_inputs.
  3. Resolve account (substring).
  4. Pull search-terms report via gads_get_report at the search-term granularity (search_term_view resource). Required fields: search_term, campaign_id/name, ad_group_id/name, impressions, clicks, cost, conversions, conv_value, ctr, cvr.
  5. Compute baselines: account-level CVR over lookback. Compute target CPA if not given (use account history / average across the scope).
  6. Apply thresholds → candidate list. Tag each candidate with the trigger reason (no-conv, low-CVR, denylist).
  7. Cluster candidates by intent. Group on shared roots / themes (e.g. free trial spreadsheet, free template excel, free download → cluster "free*"). For each cluster, propose:
    • Negative keyword(s) (the minimum tokens needed to block the cluster — usually a phrase).
    • Match type (phrase by default; exact for single-token denylist hits; phrase for multi-word patterns).
    • Scope (account / campaign / ad-group) per the rules above.
  8. Build a preview table showing every proposed negative with: keyword, match, scope, target campaigns/ad groups, wasted spend that would have been blocked, and a sample of 1–3 search terms it covers. Wait for user confirmation.
  9. Execute:
    • Account-level batch → if a list with the right purpose already exists, use gads_add_keywords_to_negative_list. If not, gads_create_negative_keyword_list then gads_add_keywords_to_negative_list then gads_attach_negative_list_to_campaigns.
    • Campaign-level batch → gads_add_negative_keywords_to_campaigns.
    • Ad-group-level batch → gads_add_negative_keywords_to_ad_groups.
  10. Confirm: count by scope, total estimated spend blocked.

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 84 lines · 50 tokens per session scan A 4a761fc0c384

Subscribe to this mod's changes

negative-keyword-sweep is a command published in the GitHub repository markifact/markifact-mcp (48 stars, last pushed 17d ago), licensed MIT. It adds 50 tokens to every session and 1,534 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.