From 8392c18dc85830f0a177ab0ce1485bf1e09922d3 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 12 Mar 2026 14:18:43 -0700 Subject: [PATCH] fix: add production flag warning to integration prompt The prompt now explicitly reminds the LLM to tell publishers about the production=True flag. Without it, the API returns 204/test ads. Made-with: Cursor --- mcp-server/server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mcp-server/server.py b/mcp-server/server.py index ee28b77..654b01b 100644 --- a/mcp-server/server.py +++ b/mcp-server/server.py @@ -311,6 +311,9 @@ def integrate_gravity_ads(framework: str = "fastapi", format: str = "card") -> s Important: - ALWAYS extract and pass site theme tokens. Never generate code without them. +- Generated code defaults to test mode (`production=False`). Remind the publisher + to set `production: true` (JS) or `production=True` (Python) when ready to serve + real ads. Without this, the API returns 204 No Content or only test ads. - The `getAds()` / `get_ads()` function **never throws** — returns empty array on failure. - Start the ad request early (before/alongside the LLM stream), await after streaming. - Always use `ad.clickUrl` for links, not `ad.url`.