The gdelt_system_prompt is the comprehensive system prompt that provides AI assistants with everything they need to effectively query GDELT data. It includes table overviews, code references, query rules, and workflow guidance.
This prompt requires no parameters and returns a complete system message ready for use with any LLM.
from shared.mcp_config import get_mcp_client# Initialize MCP clientmcp_client = get_mcp_client(api_key="gdelt_sk_...")# Fetch the system promptmessages = await mcp_client.get_prompt( "gdelt-cloud", "gdelt_system_prompt")# Messages is a list of Message objectssystem_prompt_text = "\n\n".join(msg.content for msg in messages)# Use in agent initializationagent = create_agent( model=llm, system_prompt=system_prompt_text + "\n\n" + your_additional_context, tools=gdelt_tools)
Question type to Table selection:"What did [country/actor] do?" → gdelt_events"Show me [event type] events" → gdelt_events"Find protests/violence in [location]" → gdelt_events"What's trending today?" → mv_event_mention_stats"Show me viral events" → mv_event_mention_stats"What has the most coverage?" → mv_event_mention_stats"Find articles about [topic/theme]" → gdelt_gkg_themes_extracted"Show me climate change news" → gdelt_gkg_themes_extracted"Track mentions of [person]" → gdelt_gkg_persons_extracted"Who is being discussed?" → gdelt_gkg_persons_extracted"Find coverage of [company/org]" → gdelt_gkg_organizations_extracted"Where is [topic] being discussed?" → gdelt_gkg_locations_extracted"Historical analysis of [person]" → gdelt_persons_master"Lifetime coverage of [organization]" → gdelt_organizations_master
MANDATORY REQUIREMENTS:1. DATE FILTER - Always required ✓ WHERE day >= today() - INTERVAL 7 DAY ✓ WHERE date_time >= now() - INTERVAL 24 HOUR ✓ WHERE day BETWEEN '2025-01-01' AND '2025-01-31'2. LIMIT CLAUSE - Always required (max 1000) ✓ LIMIT 100 ✓ LIMIT 500 ✓ LIMIT 10003. SOURCE URL - Always required in SELECT ✓ SELECT ..., source_url FROM gdelt_events ✓ SELECT ..., document_identifier FROM gdelt_gkg_*CRITICAL DISTINCTION:• CAMEO country codes (ISO-3): USA, CHN, GBR → for WHO (actors) Use with: actor1_country_code, actor2_country_code• FIPS country codes (2-char): US, CH, UK → for WHERE (locations) Use with: action_geo_country_code, *_geo_country_code, country_codeNEVER MIX THESE UP!
import anthropic# Fetch system promptasync with FastMCPClient() as client: await client.connect_http("https://gdelt-cloud-mcp.fastmcp.app/mcp", headers={"Authorization": "Bearer gdelt_sk_..."}) prompt_result = await client.get_prompt("gdelt_system_prompt") system_text = "\n\n".join(msg.content for msg in prompt_result.messages)# Use with Claudeclient = anthropic.Anthropic()response = client.messages.create( model="claude-3-5-sonnet-20241022", max_tokens=4096, system=system_text, messages=[ {"role": "user", "content": "Find protests in France last week"} ])
Combine with your own context - The system prompt provides GDELT expertise. Add your own instructions for task-specific behavior (tone, output format, citations, etc.).
Update periodically - As GDELT Cloud evolves, the system prompt may be updated. Fetch it at agent initialization rather than hard-coding.
Verify tool availability - Ensure agents have access to all 4 GDELT tools (prepare_gdelt_query, execute_query, present_sql, get_resource) along with the prompt.
Don’t override critical rules - The date filter, LIMIT, and source URL requirements are enforced by the backend. Don’t tell agents to skip them.
custom_prompt = gdelt_system_prompt + """EXAMPLE WORKFLOWS:User: "Find protests in France"1. prepare_gdelt_query(tables=["gdelt_events"], include_cameo_event_codes=True, include_fips_country_codes=True)2. execute_query(query="SELECT day, actor1_name, event_code, source_url FROM gdelt_events WHERE day >= today() - INTERVAL 7 DAY AND event_root_code = '14' AND action_geo_country_code = 'FR' LIMIT 100")3. Present results with source citationsUser: "Create alert for climate articles"1. prepare_gdelt_query(tables=["gdelt_gkg_themes_extracted"], include_theme_gdelt_taxonomy=True)2. present_sql(query="SELECT day, theme, document_identifier FROM gdelt_gkg_themes_extracted WHERE day >= today() - INTERVAL 1 DAY AND theme LIKE 'ENV_CLIMATE%' LIMIT 500", description="Daily climate change articles")3. Confirm with user before creating alert"""