

Global Debt & Fiscal Explorer
Data
Available ActionsEach successful request consumes credits as outlined below.
query_fiscal_data30cr
Details
Explore the financial health of any country in the world. Look up national debt levels, government spending, tax revenue, and fiscal balances — all expressed as easy-to-understand ratios and percentages of GDP. Compare countries, track trends over time, and assess debt sustainability at a glance.
Use Cases
Research a country's national debt level, Compare government debt across countries, Analyze tax revenue trends over time, Check fiscal balance and budget deficits, Evaluate debt sustainability ratios, Study public expenditure patterns, Track debt service costs, Support academic research on fiscal policy, Assess sovereign credit risk indicators, Monitor government revenue as a percentage of GDP
Connect Your Agent In 5 Min
Watch the setup guide for your platform
Or Install Locally
STDIO connector for Claude Code, Codex, Cursor, Zed, and other LLMs that require STDIO or custom connections. This lightweight connector routes requests to https://api.agentpmt.com/mcp. All tool execution happens in the cloud and the server cannot edit any files on your computer.
npm install -g @agentpmt/mcp-routeragentpmt-setupActions(1)
query_fiscal_data30cr4 paramsQuery national debt, government revenue, public expenditure, fiscal balance, and debt service data for any country or region from the World Bank.
query_fiscal_data30cr4 paramsQuery national debt, government revenue, public expenditure, fiscal balance, and debt service data for any country or region from the World Bank.
country_or_regionstringCountry name or region (e.g., 'United States', 'Greece', 'Kenya', 'World'). Defaults to 'World' if not provided.
fiscal_aspectstringFiscal aspect to query: 'debt', 'balance', 'revenue', 'expenditure', 'debt_service', or 'all'. Defaults to 'all'.
Values:
debtbalancerevenueexpendituredebt_serviceall
Default:
allcalculate_debt_ratiosbooleanCalculate debt sustainability ratios and compare against IMF/World Bank thresholds.
Default:
truetime_periodstringTime period: 'latest' for most recent data, a specific year like '2020', or a range like '2015:2020'.
Default:
latestcurl -X POST "https://api.agentpmt.com/products/purchase" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ********" \
-d '{
"product_id": "6980e39971cad8f61bf5b211",
"parameters": {
"action": "query_fiscal_data",
"fiscal_aspect": "all",
"calculate_debt_ratios": true,
"time_period": "latest"
}
}'import requests
import json
url = "https://api.agentpmt.com/products/purchase"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer ********"
}
data = {
"product_id": "6980e39971cad8f61bf5b211",
"parameters": {
"action": "query_fiscal_data",
"fiscal_aspect": "all",
"calculate_debt_ratios": true,
"time_period": "latest"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.status_code)
print(response.json())const url = "https://api.agentpmt.com/products/purchase";
const headers = {
"Content-Type": "application/json",
"Authorization": "Bearer ********"
};
const data = {
product_id: "6980e39971cad8f61bf5b211",
parameters: {
"action": "query_fiscal_data",
"fiscal_aspect": "all",
"calculate_debt_ratios": true,
"time_period": "latest"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));const axios = require('axios');
const url = "https://api.agentpmt.com/products/purchase";
const headers = {
"Content-Type": "application/json",
"Authorization": "Bearer ********"
};
const data = {
product_id: "6980e39971cad8f61bf5b211",
parameters: {
"action": "query_fiscal_data",
"fiscal_aspect": "all",
"calculate_debt_ratios": true,
"time_period": "latest"
}
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.status);
console.log(response.data);
})
.catch(error => {
console.error("Error:", error.message);
});Login to view your API and budget keys. The example above uses placeholder values. Sign in to see personalized code with your bearer token.
This tool supports credit-based access for external agents using AgentAddress identities or standard crypto wallets. External agents should use the External Agent API to buy credits with x402 and invoke this tool.
1. Buy Credits
Purchase credits via x402 payment (500 credit minimum, 100 credits = $1).
# Request payment requirements (returns 402 + PAYMENT-REQUIRED header)
curl -i -s -X POST "https://www.agentpmt.com/api/external/credits/purchase" \
-H "Content-Type: application/json" \
-d '{ "wallet_address":"0xYOUR_WALLET", "credits": 500, "payment_method":"x402" }'
# Sign the EIP-3009 authorization, then retry with signature header
curl -s -X POST "https://www.agentpmt.com/api/external/credits/purchase" \
-H "Content-Type: application/json" \
-H "PAYMENT-SIGNATURE: <base64-json>" \
-d '{ "wallet_address":"0xYOUR_WALLET", "credits": 500, "payment_method":"x402" }'2. Create a Session Nonce (nonce used in signed balance/invoke)
curl -s -X POST "https://www.agentpmt.com/api/external/auth/session" \
-H "Content-Type: application/json" \
-d '{ "wallet_address":"0xYOUR_WALLET" }'3. Invoke This Tool
Sign the message with your wallet (EIP-191 personal-sign), then POST to the invoke endpoint.
# Sign this message (wallet MUST be lowercased):
# agentpmt-external
# wallet:0xyourwallet...
# session:<session_nonce>
# request:<request_id>
# method:POST
# path:/external/tools/debt-fiscal-management/actions/<actionSlug>/invoke
# payload:<sha256(canonical_json(parameters))>
curl -s -X POST "https://www.agentpmt.com/api/external/tools/debt-fiscal-management/actions/<actionSlug>/invoke" \
-H "Content-Type: application/json" \
-d '{
"wallet_address": "0xYOUR_WALLET",
"session_nonce": "<session_nonce>",
"request_id": "invoke-uuid",
"signature": "0x<signature>",
"parameters": {
"your_param": "value"
}
}'Usage Instructions
Usage guidance provided directly by the developer for this product.
Global Debt & Fiscal Explorer
Query national debt levels, government spending, tax revenue, fiscal balances, and debt sustainability indicators for any country from the World Bank World Development Indicators database.
Actions
query_fiscal_data
Fetch fiscal and debt data for a country or region with optional debt sustainability assessment.
Optional fields (all have defaults):
country_or_region(string) — Country name or region in plain English (e.g.,"United States","Greece","Kenya","World"). Defaults to"World"if not provided. Supports plain English names or ISO3 codes.fiscal_aspect(string) — Which category of fiscal data to query. Default:"all"."debt"— External debt stocks, external debt/GNI ratio, central government debt/GDP, short-term and long-term debt, debt service/exports ratio"balance"— Cash surplus/deficit (% of GDP), primary balance (% of GDP)"revenue"— Tax revenue (% of GDP), government revenue excluding grants (% of GDP)"expenditure"— Government expense (% of GDP), education/health/military expenditure (% of GDP)"debt_service"— Total debt service, debt service/exports ratio, interest payments (% of revenue), multilateral and bilateral debt"all"— All fiscal indicators combined
calculate_debt_ratios(boolean) — Calculate debt sustainability ratios and compare against IMF/World Bank Debt Sustainability Framework thresholds. Default:true.time_period(string) — Default:"latest"."latest"— Most recent 10 data points (returns the most recent non-null value)"YYYY"— Specific year (e.g.,"2020")"YYYY:YYYY"— Year range (e.g.,"2015:2020")
Example — All fiscal data for a country:
{
"country_or_region": "Kenya",
"fiscal_aspect": "all",
"time_period": "latest"
}
Example — Debt sustainability analysis:
{
"country_or_region": "Greece",
"fiscal_aspect": "debt",
"calculate_debt_ratios": true,
"time_period": "latest"
}
Example — Government revenue over time:
{
"country_or_region": "United States",
"fiscal_aspect": "revenue",
"time_period": "2015:2023"
}
Example — Expenditure breakdown:
{
"country_or_region": "Nigeria",
"fiscal_aspect": "expenditure",
"time_period": "latest"
}
Example — Fiscal balance for a specific year:
{
"country_or_region": "Brazil",
"fiscal_aspect": "balance",
"time_period": "2022"
}
Example — Debt service analysis:
{
"country_or_region": "Sri Lanka",
"fiscal_aspect": "debt_service",
"calculate_debt_ratios": true,
"time_period": "2018:2023"
}
Response Format
Responses include:
- data — Per-indicator results with value, date, country name, indicator description, and unit. For time-range queries, includes a
time_seriesarray of date/value pairs. - debt_sustainability_assessment — When
calculate_debt_ratiosis true and debt data is available:overall_risk_level— low, moderate, high, or criticalsustainability_indicators— Individual ratio assessments against IMF/World Bank thresholdsrisk_factors— List of identified debt risks
- fiscal_balance_assessment — Fiscal position analysis:
fiscal_position— surplus or deficitsustainability_level— strong, sustainable, warning, or critical- Maastricht criterion comparison (-3% GDP threshold)
- fiscal_space_analysis — Revenue vs. expenditure analysis:
- Revenue and expense as % of GDP
- Interest burden assessment
- Revenue mobilization assessment (weak/moderate/strong/very strong)
- expenditure_allocation — Education, health, and military spending as % of GDP
- sdg_alignment — SDG 8, 16, and 17 alignment information
- summary — Data availability statistics
Fiscal Indicators by Aspect
| Aspect | Indicators |
|---|---|
| debt | External debt stocks (US$), External debt/GNI %, Central govt debt/GDP %, Short-term debt, Long-term debt, Debt service/exports % |
| balance | Cash surplus/deficit (% GDP), Primary balance (% GDP) |
| revenue | Tax revenue (% GDP), Government revenue excl. grants (% GDP) |
| expenditure | Government expense (% GDP), Education spending (% GDP), Health spending (% GDP), Military spending (% GDP) |
| debt_service | Total debt service (US$), Debt service/exports %, Interest payments (% revenue), Multilateral debt, Bilateral debt |
Debt Sustainability Thresholds (IMF/World Bank DSF)
| Indicator | Low Risk | Moderate Risk | High Risk |
|---|---|---|---|
| External debt/GNI | < 30% | 30-40% | > 55% |
| Debt service/exports | < 15% | 15-20% | > 25% |
| Government debt/GDP | < 50% | 50-70% | > 90% |
Important Notes
- Data is sourced from the World Bank World Development Indicators database.
- Country names are resolved against a built-in mapping; use common English names or ISO3 codes.
- Data availability varies significantly by country; developing countries may have more gaps.
- Most recent data may be 1-3 years behind the current year.
- Percentage indicators with suspiciously small values are automatically corrected for a known World Bank API scaling bug.
- Years must be between 1960 and the current year.





