Skip to main content
Glama

wbgapi360

World Bank Data API client with two interfaces: A synchronous Python API for analysts, and a Model Context Protocol (MCP) server for AI agents.

PyPI version Python CI Downloads License: MIT


What You Get

  • Smart indicator discovery (search) with heuristic ranking.

  • High-level data retrieval (get_data) with code normalization.

  • Publication-style charts (plot) with optional visual dependencies.

  • MCP tools for search, data access, comparisons, trend analysis, rankings, and chart generation.

Related MCP server: Countries MCP Server

Installation

pip install wbgapi360

Optional extras:

# Visualization support (matplotlib + seaborn)
pip install "wbgapi360[visual]"

# Mapping support (geopandas + matplotlib)
pip install "wbgapi360[map]"

Python API (Analysts)

import wbgapi360 as wb

# 1) Search indicators
results = wb.search("inflation")
for r in results[:3]:
    print(f"[{r['code']}] {r['name']}")

# 2) Fetch data
df = wb.get_data(
    indicator="NY.GDP.MKTP.KD.ZG",
    economies=["USA", "CHN", "PER"],
    years=10
)
print(df.head())

# 3) Plot (requires: pip install "wbgapi360[visual]")
wb.plot(
    chart_type="trend",
    data=df,
    title="GDP Growth",
    subtitle="Annual %"
)

MCP Server (AI Agents)

Run the server

After installation:

wbgapi360

From repository source:

python -m wbgapi360.mcp.server

Claude Desktop example

{
  "mcpServers": {
    "worldbank": {
      "command": "wbgapi360",
      "args": []
    }
  }
}

MCP tools

Tool

Description

search_indicators

Semantic search for indicator codes.

get_data

Retrieve time series data for one or many countries.

compare_countries

Compare countries across one or many indicators.

analyze_trend

Return trend statistics (growth, volatility, direction).

rank_countries

Rank countries for an indicator globally or by region.

plot_chart

Generate chart images from JSON payloads.

CLI (Developer Utility)

A separate CLI is provided for manual testing and quick queries:

wbgapi360-cli --help

Commands:

  • search

  • data

  • config

Development

pip install -e ".[dev,visual]"
python -m pytest -q tests

Project Notes

Unofficial client

This software is an independent open-source project. It is not affiliated with The World Bank Group.

Attribution

wbgapi360 is inspired by Tim Herzog's original wbgapi project and extends it with MCP support and AI-focused workflows.

Author

Maykol Medrano
Applied Economist / Policy Data Scientist
Email: mmedrano2@uc.cl

License

MIT. See LICENSE.

Available Tools

6 tools
analyze_trendA

Analyze time-series trend with statistical insights.

Returns growth rates, volatility, trend direction, and more.

ParametersJSON Schema
NameRequiredDescriptionDefault
yearsNoYears of historical data (default: 20)
economyYesISO3 country code
indicatorYesIndicator code
include_statsNoInclude statistical analysis (default: True)

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the tool 'Returns growth rates, volatility, trend direction, and more,' which gives some insight into output behavior. However, it does not disclose side effects, error conditions, or specifics about statistical methods, and there is no mention that the operation is read-only. The description adds limited context beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise: two sentences that front-load the primary purpose and then list key outputs. It avoids filler and is appropriately sized for the tool's complexity. A slight deduction because it could have packed more useful guidance (e.g., a usage tip) without much extra length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema, so the description need not detail return values. However, the description lacks context about when to use this analysis tool versus siblings like compare_countries or rank_countries. It also does not mention prerequisites (e.g., valid indicator codes) or limitations. Given the presence of a full output schema and 100% parameter coverage, the description is adequate but not rich enough for a higher score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all four parameters have descriptions in the input schema. The tool description does not add new meaning about parameters, such as how 'years' affects the trend analysis or how 'include_stats' changes output. Since the schema already documents all parameters, a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'Analyze time-series trend with statistical insights.' It specifies the resource (time-series trend) and the action (analyze), and distinguishes itself from siblings like get_data (fetching) and plot_chart (visualizing). The added details about output ('growth rates, volatility, trend direction') further clarify its unique role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for trend analysis but provides no explicit guidance on when to use this tool versus alternatives. It does not reference sibling tools or state conditions like 'use this when you need statistical summaries rather than raw data or charts.' The context is clear but lacks explicit exclusions or alternative recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

compare_countriesB

Compare multiple countries across indicators.

ParametersJSON Schema
NameRequiredDescriptionDefault
yearsNoYears of historical data (default: 10)
economiesYesList of ISO3 country codes
normalizeNoNormalize to 0-100 scale for comparison (default: False)
indicatorsYesOne or more indicator codes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only says 'Compare multiple countries across indicators,' which does not disclose whether this is a read-only operation, any side effects, or what the output represents. This is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single clear sentence with no wasted words. It is front-loaded and easy to parse, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The output schema and parameter schema cover technical details, so the description need not explain return values. However, it lacks usage context, such as when to choose compare_countries over rank_countries, and does not mention behavioral aspects like normalization or historical data. It is adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all four parameters (economies, indicators, years, normalize) already documented in the schema. The description adds no additional meaning beyond the schema, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool compares multiple countries across indicators, which is a specific verb+resource combination. It also distinguishes this tool from siblings like get_data or rank_countries by focusing on cross-country comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives such as rank_countries or get_data. There are no mentions of prerequisites, exclusions, or specific use cases beyond the generic statement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_dataC

Fetch World Bank data with auto-correction. Set labels=True for human-readable country names.

ParametersJSON Schema
NameRequiredDescriptionDefault
yearsNo
labelsNo
economiesYes
indicator_codeYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits. 'Auto-correction' is mentioned but not explained, and there is no detail about return format, limitations, or side effects. This is a significant gap for a data-fetching tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the main action. It is concise and free of fluff, though the unexplained 'auto-correction' term introduces ambiguity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite the presence of an output schema, the description lacks essential context: what 'auto-correction' does, how years and economies interact, and what the returned data structure represents. This is incomplete for a tool with moderate parameter complexity and important behavioral nuances.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains 'labels=True' yields human-readable country names, but years, economies, and indicator_code are left purely to their types. This is only partial value addition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches World Bank data, using a specific verb 'fetch' and resource. It distinguishes from siblings like search_indicators and plot_chart, though the phrase 'auto-correction' is vague. Overall, the core purpose is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like compare_countries or analyze_trend. The usage context is only implied by the sibling names, not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

plot_chartC

Generate chart with FT style. Advanced: region (latam/africa/europe), bbox, bins, category_labels for map_categorical.

ParametersJSON Schema
NameRequiredDescriptionDefault
bboxNo
binsNo
titleNoChart
regionNo
subtitleNo
data_jsonYes
chart_typeYes
category_labelsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must disclose behavioral traits, but it only mentions FT styling and that certain parameters are advanced for map_categorical. It does not describe output format, side effects, error handling, or data requirements, leaving significant behavioral unknowns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with the main purpose front-loaded and an advanced note appended. It is concise and free of fluff, though very brief; every sentence contributes to understanding the tool's purpose and some parameter context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 8 parameters, no annotations, and 0% schema description coverage, the description is too sparse. The output schema exists, so return values are covered, but the two required parameters (chart_type and data_json) are entirely unexplained, and the tool's behavior is only partially specified. This is inadequate for an agent to confidently invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It names region, bbox, bins, and category_labels with a hint about map_categorical, but it does not explain the required chart_type and data_json parameters, nor the meaning of bbox and bins values. This is insufficient compensation for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Generate chart with FT style', which is a specific verb+resource action that is distinct from sibling tools focused on data retrieval, comparison, and ranking. However, it does not enumerate chart types or fully differentiate its scope from potential visualization alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for chart generation, and the advanced note hints at map_categorical use. However, it provides no explicit guidance on when to use this versus siblings like analyze_trend or compare_countries, nor any exclusions or alternative recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rank_countriesB

Rank countries by indicator value.

ParametersJSON Schema
NameRequiredDescriptionDefault
top_nNoNumber of top countries to return (default: 20)
regionNoRegion filter (latam, africa, asia, europe, mena) or None for global
indicatorYesIndicator code

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure, but it only restates the core action. It does not indicate ranking direction (ascending/descending), tie handling, missing data behavior, or whether it returns only top N despite the top_n parameter. No behavioral traits are disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A concise one-sentence description that wastes no words. It is appropriately sized for a simple tool while still including the core action and object.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description fails to mention key behavioral aspects like the top_n limit or region filtering, which are crucial for a ranking tool. Even with schema coverage, the overall context is incomplete for a tool with 3 parameters and an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% coverage of all parameters (indicator, top_n, region) with descriptions, so baseline 3 applies. The description adds no extra meaning beyond the schema; 'indicator value' merely mirrors the indicator parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Rank countries by indicator value' uses a specific verb (rank) and resource (countries), clearly distinguishing it from siblings like compare_countries or get_data. It conveys a distinct operation on countries based on indicator data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like compare_countries or analyze_trend. The description does not mention any context, exclusions, or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_indicatorsC

Search for World Bank indicators using Smart Ranking.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
database_idNoWB_WDI

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden and only says 'using Smart Ranking.' It does not disclose whether the operation is read-only, what Smart Ranking entails, or the response format, leaving behavioral traits unexplained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that directly states the tool's purpose without unnecessary words. It is highly concise and front-loaded, earning the highest score for efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, the description lacks usage guidelines, parameter semantics, and behavioral context. With three parameters and sibling tools that could overlap in function, the description is insufficient for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage for its three parameters (query, limit, database_id), and the description does not explain any of them. The agent is left to infer the meaning and purpose of each parameter without any guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Search for World Bank indicators using Smart Ranking,' clearly identifying the verb and resource. However, it does not distinguish this tool from siblings like get_data or rank_countries, so it lacks explicit sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives. The description only states what it does without any context, exclusions, or mention of when it should be preferred over sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv0.1.0
    • First observedanalyze_trend
    • First observedcompare_countries
    • First observedget_data
    • First observedplot_chart
    • First observedrank_countries
    • First observedsearch_indicators

TDQS

A3.5/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: searching indicators, fetching data, plotting, comparing, analyzing trends, and ranking. No two tools appear to do the same thing.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in lowercase snake_case (search_indicators, get_data, plot_chart, compare_countries, analyze_trend, rank_countries). The naming is uniform and predictable.

Tool Count5/5

With 6 tools, the server is well-scoped for a World Bank data analysis context. Each tool covers a distinct aspect of the workflow without being excessive or minimal.

Completeness4/5

The surface covers discovery, data retrieval, visualization, comparison, trend analysis, and ranking, which is solid. A minor gap is the lack of explicit country metadata or list endpoints, but this can often be worked around with known country codes.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that interfaces with the WorldBank API to retrieve economic and labor market data such as GDP and employment indicators. It allows LLMs to query global development statistics including unemployment rates, labor force participation, and sectoral employment data.
    -
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for UNICEF child development statistics. Query 790+ child-focused indicators across 200+ countries with disaggregations by sex, age, wealth quintile, and residence. No API key required.
    9
    5
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Exposes World Bank development data and country information via MCP resources and tools, enabling AI agents to query historical indicators and live API data.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MaykolMedrano/mcp_wbgapi360'

If you have feedback or need assistance with the MCP directory API, please join our Discord server