mcpbeat Sign in

Algo Ad Gsp Agent Skill

Implement Generalized Second Price auction for ad slot allocation and pricing. Use this skill when the user needs to understand search ad auctions, compute ad positions and costs-per-click, or analyze bidding dynamics — even if they say 'how does Google Ads auction work', 'ad rank calculation', or 'second price auction for ads'.

6k tokens
context cost
the whole folder, loaded on every use
4
files
instructions only
0
copies elsewhere
how many repositories repackaged it
223
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/asgard-ai-platform/skills --skill algo-ad-gsp

What comes with it

21 772 bytes besides the instruction
examples/sample_scenario.md
references/gsp-equilibrium.md
references/gsp-vs-vcg.md

The instruction itself

14 sections, as written by the author

Generalized Second Price Auction

Overview

GSP allocates K ad slots to N bidders, assigning the highest bidder the top slot, second-highest the second slot, etc. Each winner pays the bid of the advertiser ONE POSITION BELOW them (per-slot second price). Used by Google Ads and Bing Ads. Runs in O(N log N) for sorting bids.

When to Use

Trigger conditions:

  • Understanding search engine ad auction mechanics
  • Computing ad position and cost-per-click from bid and quality data
  • Analyzing bidding strategy in sponsored search

When NOT to use:

  • When you need incentive-compatible truthful bidding (use VCG mechanism)
  • When analyzing display/programmatic ad auctions (typically use first-price)

Algorithm

IRON LAW: GSP Is NOT Incentive-Compatible
Unlike Vickrey (single-item second-price) auctions, truthful bidding
is NOT a dominant strategy in GSP. Bidders may strategically shade
bids below their true value. The equilibrium depends on competitor bids.
Ad Rank = Bid × Quality Score (Google's variant adds format/extensions).

Phase 1: Input Validation

Collect: bids, quality scores (or ad rank scores) for all competing advertisers. Define available slot positions and their click-through rate multipliers.

Gate: All bids positive, quality scores in valid range.

Phase 2: Core Algorithm

  • Compute Ad Rank for each advertiser: AdRank_i = Bid_i × QualityScore_i
  • Sort advertisers by Ad Rank descending
  • Assign top-K to slots 1 through K
  • Compute payment: CPC_i = AdRank_{i+1} / QualityScore_i (price to maintain position)
  • Last slot winner pays the minimum bid threshold

Phase 3: Verification

Check: all payments ≤ bids, positions ordered by Ad Rank, no advertiser pays more than their bid.

Gate: Payment ≤ bid for all winners, positions consistent.

Phase 4: Output

Return slot assignments with positions, CPCs, and estimated clicks.

Output Format

{
  "slots": [{"advertiser": "A", "position": 1, "ad_rank": 8.5, "cpc": 2.10, "est_clicks": 100}],
  "metadata": {"total_bidders": 15, "slots_available": 4, "auction_type": "gsp"}
}

Examples

Sample I/O

Input: Bidders: A(bid=3, QS=8), B(bid=4, QS=5), C(bid=2, QS=9). Slots: 2.

Expected: Ranks: A=24, C=18, B=20. Order: A(1st), B(2nd). CPC_A = 20/8 = 2.50, CPC_B = 18/5 = 3.60.

Edge Cases

| Input | Expected | Why |

|-------|----------|-----|

| Tie in Ad Rank | Platform tiebreaker (historical CTR, etc.) | GSP needs strict ordering |

| One bidder | Wins slot 1, pays minimum CPC | No competition → floor price |

| Bid below threshold | Not eligible | Minimum bid requirement enforced |

Gotchas

  • Quality Score is opaque: Google's QS includes expected CTR, ad relevance, and landing page experience. The exact formula is proprietary.
  • Strategic bid shading: Since GSP isn't truthful, sophisticated advertisers shade bids. This means observed bids don't reflect true willingness to pay.
  • Position ≠ value: Higher position gets more clicks but at higher CPC. The most profitable position may be #2 or #3, not #1.
  • Budget constraints: GSP doesn't account for daily budgets. Budget-constrained advertisers must pace bids throughout the day.
  • Broad match expansion: The auction includes query-expanded matches, which may have different conversion rates than exact matches.

References

  • For Nash equilibrium analysis of GSP, see references/gsp-equilibrium.md
  • For comparison with VCG mechanism, see references/gsp-vs-vcg.md

Other skills for the same job

different authors, same section of the catalogue
Internal Comms
by anthropics
vendor ×13

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

6k tokens
Competitive Ads Extractor
by frostant
×10

Extracts and analyzes competitors' ads from ad libraries (Facebook, LinkedIn, etc.) to understand what messaging, problems, and creative approaches are working. Helps inspire and improve your own ad campaigns.

2k tokens
Lead Research Assistant
by frostant
×8

Identifies high-quality leads for your product or service by analyzing your business, searching for target companies, and providing actionable contact strategies. Perfect for sales, business development, and marketing professionals.

2k tokens
Developer Growth Analysis
by frostant
×6

Analyzes your recent Claude Code chat history to identify coding patterns, development gaps, and areas for improvement, curates relevant learning resources from HackerNews, and automatically sends a personalized growth report to your Slack DMs.

4k tokens
App Store Optimization
by alirezarezvani
×3

Complete App Store Optimization (ASO) toolkit for researching, optimizing, and tracking mobile app performance on Apple App Store and Google Play Store

55k tokens scripts
Deeptools
by christophacham
×3

NGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.

21k tokens scripts
Pymatgen
by christophacham
×3

Materials science toolkit. Crystal structures (CIF, POSCAR), phase diagrams, band structure, DOS, Materials Project integration, format conversion, for computational materials science.

26k tokens scripts
Enhance Prompt
by google-labs-code
vendor ×2

Transforms vague UI ideas into polished, Stitch-optimized prompts. Enhances specificity, adds UI/UX keywords, injects design system context, and structures output for better generation results.

3k tokens

How to use it

Copy the folder

Take asgard-ai-platform/algo-ad-gsp from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.