Ad Spec Guard

v1.0.0
io.github.notformal/ad-spec-guard Checked 4 days ago Published 14 days ago

Ad platform character limits, creative specs, A/B significance, UTM and policy checks.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_platform_specs

Return the verified specification sheet for one ad platform: hard character limits per copy field, image formats with their required dimensions and file size caps, learning-phase windows, and the conversion history automated bidding needs. Call this before writing ad copy or briefing creative, instead of relying on remembered limits, which change and are frequently misremembered.

ParameterTypeDescription
platform *stringAd platform. One of: google, linkedin, meta, microsoft, telegram, tiktok.
sectionstringWhich part of the sheet to return.

validate_ad_copy

Check drafted ad copy against the hard character limits of one platform, field by field, and report which fields exceed the limit and by how much. Use it on every draft before presenting it, because copy over the limit is rejected when the ad is uploaded, not when it is written.

ParameterTypeDescription
fields *objectMap of field name to the drafted text, for example {"headline": "Same day delivery", "description": "..."}; several texts of one field as a list, {"headline": ["A", "B"]}, each checked on its own. Cal…
platform *stringAd platform. One of: google, linkedin, meta, microsoft, telegram, tiktok.
campaign_typestringOptional campaign type, for example 'search' or 'performance_max'. Recorded in the result.
languagestringLanguage tag of the copy. Characters are counted as code points.

validate_creative_spec

Check an image or video against a platform placement's required dimensions, aspect ratio, file size cap and accepted file types. Width and height are enough to answer whether a size fits a placement; supply file size and type as well when the file exists, and the result says which checks it could not perform. Returns each violation with its severity and the expected value.

ParameterTypeDescription
format_key *stringPlacement format, for example 'feed_1x1' or 'story_9x16'. Call get_platform_specs with section 'image' for the list.
height *integerPixel height of the file or of the planned creative.
platform *stringAd platform. One of: google, linkedin, meta, microsoft, telegram, tiktok.
width *integerPixel width of the file or of the planned creative.
file_bytesintegerFile size in bytes. Omit it when the file does not exist yet or its size is unknown; the weight check is then reported as not performed. Never estimate it.
file_extensionstringFile type without the dot, for example 'jpg', 'png', 'mp4'. Omit it when unknown; the type check is then reported as not performed.

check_decision_readiness

Decide whether a live campaign has produced enough data to justify pausing it, scaling its budget, rotating a creative or switching bidding strategy, and whether it is still inside the platform's learning phase. Returns the unmet requirements with the shortfall and an estimate of how long to wait. Call it before recommending any change and before calling a metric good or bad. For a verdict on a cost per acquisition or return on ad spend use 'judge_metric'; for a verdict on a click-through rate or conversion rate use 'judge_rate_metric', which is gated on clicks rather than conversions.

ParameterTypeDescription
decision *stringThe decision being considered.
platform *stringAd platform. Known keys: google, google_display, google_search, linkedin, meta, microsoft, tiktok.
clicksnumberClicks recorded so far.
conversionsnumberConversions recorded so far. Omit it if it was not measured; do not pass 0 for unknown, because zero conversions after real traffic is a finding.
days_runningnumberDays the campaign has been delivering.
impressionsnumberImpressions recorded so far.
spendnumberAmount spent so far, in USD.

ab_test_significance

Run a two-proportion z-test on two variants of an ad, landing page or audience, and report the p-value, whether the difference is statistically significant at the chosen confidence level, and how much more traffic would be needed to resolve it if it is not. Use it for any comparison of two rates instead of judging the gap by eye.

ParameterTypeDescription
variant_a_successes *integerNumerator for variant A.
variant_a_trials *integerDenominator for variant A: impressions for a click rate, clicks for a conversion rate.
variant_b_successes *integerNumerator for variant B.
variant_b_trials *integerDenominator for variant B.
confidencenumberConfidence level for the test.

build_utm

Assemble a campaign URL with consistent UTM tagging, normalise the values so they do not split into duplicate rows in analytics, and report every correction made and every risk found. Also flags a source or medium that departs from the conventional value for the platform, which silently breaks channel grouping.

ParameterTypeDescription
base_url *stringLanding page URL, with or without an existing query string.
campaign *stringCampaign name.
medium *stringTraffic medium, for example 'cpc' or 'paid_social'.
source *stringTraffic source, for example 'google' or 'facebook'.
contentstringOptional creative or variant identifier.
conventionstringNaming convention applied to every value.
platformstringOptional platform key, used to check source and medium against the conventional values.
termstringOptional keyword or audience term.

validate_utm

Inspect the UTM parameters already on a URL and report missing required parameters and values that will fragment reporting, such as mixed case or encoded spaces. Does not rewrite the URL.

ParameterTypeDescription
url *stringThe tagged URL to inspect.

estimate_budget_feasibility

Work out whether a monthly budget can reach a target cost per acquisition or return on ad spend, and whether it produces enough weekly conversions for automated delivery to leave the learning phase. Nothing is filled in from industry averages: for any input not supplied, it solves for the value the goal would require and labels it as a condition rather than a forecast.

ParameterTypeDescription
monthly_budget *numberPlanned monthly media budget.
ad_setsintegerHow many ad sets or campaigns the budget is split across.
avg_order_valuenumberAverage order value, required with a return goal.
currencystringCurrency code for the amounts supplied.
expected_cpcnumberCost per click. Supply it only if measured or quoted.
expected_cvrnumberConversion rate, as 0.03 or 3 for three percent. Supply it only if measured.
target_cpanumberTarget cost per acquisition.
target_roasnumberTarget return on ad spend, as a multiple such as 4 for 4x.

check_ad_policy_preflight

Scan ad copy for the two patterns behind most rejections: a business category the platform prohibits or gates behind certification, and a claim the platform treats as unverifiable. Returns each match with the governing policy page. This is a pattern pre-check, not an approval; only the platform's review decides whether an ad runs.

ParameterTypeDescription
platform *stringAd platform. Known keys: apple, google, linkedin, meta, microsoft, reddit, telegram, tiktok.
text *stringThe ad copy to check.
landing_urlstringOptional landing page URL, checked alongside the copy.
verticalstringOptional business category, for example 'dental clinic'.