{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentGlobal",
    "version": "1.0.0",
    "description": "Global macroeconomic data from IMF, World Bank, and OECD. GDP growth, inflation, interest rates, and development indicators for 180+ countries. Pay-per-request via x402 protocol on Base mainnet.",
    "contact": {
      "name": "Ocean Digital Group",
      "url": "https://memoryapi.org"
    }
  },
  "servers": [
    {
      "url": "https://global.memoryapi.org",
      "description": "Production"
    }
  ],
  "paths": {
    "/x402/global/gdp": {
      "get": {
        "summary": "IMF GDP & macro indicators",
        "description": "Global GDP and macroeconomic indicators from the IMF World Economic Outlook. GDP growth, inflation, government debt, current account balance, GDP per capita.",
        "x-price": "$0.001 USDC",
        "parameters": [
          {
            "name": "countries",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "USA,CHN,DEU,GBR,JPN,FRA,IND,BRA"
            },
            "description": "Comma-separated ISO-3 country codes"
          },
          {
            "name": "indicator",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "NGDP_RPCH",
                "PCPIPCH",
                "GGXWDG_NGDP",
                "BCA_NGDPD",
                "NGDPDPC"
              ],
              "default": "NGDP_RPCH"
            },
            "description": "IMF indicator: NGDP_RPCH=GDP growth, PCPIPCH=inflation, GGXWDG_NGDP=gov debt, BCA_NGDPD=current account, NGDPDPC=GDP per capita"
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Year for data (default: current year)"
          }
        ],
        "responses": {
          "200": {
            "description": "IMF macroeconomic data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required \u2014 send x402 payment header"
          }
        }
      }
    },
    "/x402/global/worldbank": {
      "get": {
        "summary": "World Bank development indicators",
        "description": "Development indicators from the World Bank for major countries. GDP, population, inflation, unemployment, GDP per capita, Gini index.",
        "x-price": "$0.001 USDC",
        "parameters": [
          {
            "name": "countries",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "US;CN;DE;GB;JP;FR;IN;BR;CA;AU"
            },
            "description": "Semicolon-separated ISO-2 country codes"
          },
          {
            "name": "indicator",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "NY.GDP.MKTP.CD"
            },
            "description": "World Bank indicator code (e.g. NY.GDP.MKTP.CD, SP.POP.TOTL, FP.CPI.TOTL.ZG)"
          },
          {
            "name": "mrv",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Most recent values count"
          }
        ],
        "responses": {
          "200": {
            "description": "World Bank indicator data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required \u2014 send x402 payment header"
          }
        }
      }
    },
    "/x402/global/oecd": {
      "get": {
        "summary": "OECD country comparison indicators",
        "description": "OECD data for G7 and major economies. Long-term interest rates, current account/trade balance, and CPI/inflation.",
        "x-price": "$0.001 USDC",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "interest_rates",
                "trade_balance",
                "cpi"
              ],
              "default": "interest_rates"
            },
            "description": "Data topic"
          },
          {
            "name": "countries",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "USA,CAN,DEU,FRA,GBR,ITA,JPN"
            },
            "description": "Comma-separated ISO-3 country codes (default: G7)"
          }
        ],
        "responses": {
          "200": {
            "description": "OECD indicator data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalDataResponse"
                }
              }
            }
          },
          "402": {
            "description": "Payment required \u2014 send x402 payment header"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP endpoint",
        "description": "Model Context Protocol endpoint. Tools: get_global_gdp, get_world_bank_data, get_oecd_indicators",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  },
                  "id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response"
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "schemas": {
      "GlobalDataResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "indicator": {
            "type": "string"
          },
          "indicator_label": {
            "type": "string"
          },
          "year": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "country": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                },
                "unit": {
                  "type": "string"
                }
              }
            }
          },
          "source": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "x402": {
        "type": "http",
        "scheme": "bearer",
        "description": "x402 payment protocol \u2014 send USDC payment on Base mainnet"
      }
    }
  }
}