REST Countries · Capability

REST Countries — Country Lookup

REST Countries lookup capability. Bulk listing plus lookups by name, alpha code, currency, language, capital, region, subregion, translation, demonym, and independence status. Self-contained Naftiko capability over the public restcountries.com v3.1 surface.

Run with Naftiko REST CountriesCountriesReference DataGeography

What You Can Do

GET
Listallcountries — List all countries.
/v3.1/all
GET
Getcountriesbyname — Search countries by name.
/v3.1/name/{name}
GET
Getcountrybyalphacode — Get country by alpha code.
/v3.1/alpha/{code}
GET
Getcountriesbyregion — Filter countries by UN region.
/v3.1/region/{region}

MCP Tools

list-all-countries

List all countries (fields required).

read-only idempotent
get-countries-by-name

Search countries by common or official name.

read-only idempotent
get-country-by-alpha-code

Get country by ISO 3166-1 code.

read-only idempotent
get-countries-by-currency

Search countries by currency code or name.

read-only idempotent
get-countries-by-language

Search countries by language code or name.

read-only idempotent
get-countries-by-capital

Search countries by capital city.

read-only idempotent
get-countries-by-region

Filter countries by UN region.

read-only idempotent
get-countries-by-subregion

Filter countries by UN subregion.

read-only idempotent
get-countries-by-translation

Search countries by translated name.

read-only idempotent
list-independent-countries

Filter countries by independence status.

read-only idempotent

Capability Spec

rest-countries-lookup.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: REST Countries — Country Lookup
  description: 'REST Countries lookup capability. Bulk listing plus lookups by name, alpha code, currency, language, capital, region, subregion, translation, demonym, and independence status. Self-contained Naftiko capability over the public restcountries.com v3.1 surface.'
  tags:
  - REST Countries
  - Countries
  - Reference Data
  - Geography
  created: '2026-05-29'
  modified: '2026-05-29'
binds: []
capability:
  consumes:
  - type: http
    namespace: rest-countries-lookup
    baseUri: https://restcountries.com/v3.1
    description: REST Countries v3.1 read-only lookup surface. Unauthenticated public API.
    resources:
    - name: all
      path: /all
      operations:
      - name: listAllCountries
        method: GET
        description: List all countries (fields parameter required).
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: fields
          in: query
          type: string
          description: Comma-separated list of fields (up to 10).
          required: true
    - name: name
      path: /name/{name}
      operations:
      - name: getCountriesByName
        method: GET
        description: Search countries by common or official name.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: name
          in: path
          type: string
          description: Country name (partial or full).
          required: true
        - name: fullText
          in: query
          type: boolean
          description: Require exact full-name match.
          required: false
    - name: alpha-code
      path: /alpha/{code}
      operations:
      - name: getCountryByAlphaCode
        method: GET
        description: Get a single country by ISO 3166-1 alpha-2, alpha-3, numeric, or CIOC code.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: code
          in: path
          type: string
          description: ISO 3166-1 code (cca2, cca3, ccn3, or cioc).
          required: true
    - name: alpha-batch
      path: /alpha
      operations:
      - name: getCountriesByAlphaCodes
        method: GET
        description: Batch country lookup by comma-separated codes.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: codes
          in: query
          type: string
          description: Comma-separated list of ISO 3166-1 codes.
          required: true
    - name: currency
      path: /currency/{currency}
      operations:
      - name: getCountriesByCurrency
        method: GET
        description: Search countries by ISO 4217 currency code or name.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: currency
          in: path
          type: string
          description: Currency code or name.
          required: true
    - name: language
      path: /lang/{language}
      operations:
      - name: getCountriesByLanguage
        method: GET
        description: Search countries by ISO 639 language code or language name.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: language
          in: path
          type: string
          description: Language code or name.
          required: true
    - name: capital
      path: /capital/{capital}
      operations:
      - name: getCountriesByCapital
        method: GET
        description: Search countries by capital city.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: capital
          in: path
          type: string
          description: Capital city name.
          required: true
    - name: region
      path: /region/{region}
      operations:
      - name: getCountriesByRegion
        method: GET
        description: Filter countries by UN region.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: region
          in: path
          type: string
          description: UN region name (africa, americas, antarctic, asia, europe, oceania).
          required: true
    - name: subregion
      path: /subregion/{subregion}
      operations:
      - name: getCountriesBySubregion
        method: GET
        description: Filter countries by UN subregion.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: subregion
          in: path
          type: string
          description: UN subregion name.
          required: true
    - name: translation
      path: /translation/{translation}
      operations:
      - name: getCountriesByTranslation
        method: GET
        description: Search countries by translated name.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: translation
          in: path
          type: string
          description: Translated country name.
          required: true
    - name: demonym
      path: /demonym/{demonym}
      operations:
      - name: getCountriesByDemonym
        method: GET
        description: Search countries by demonym.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: demonym
          in: path
          type: string
          description: Demonym (e.g. french, peruvian).
          required: true
    - name: independent
      path: /independent
      operations:
      - name: listIndependentCountries
        method: GET
        description: Filter countries by independence status.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: array
          value: $.
        inputParameters:
        - name: status
          in: query
          type: boolean
          description: Independence status filter.
          required: false
    authentication:
      type: none
  exposes:
  - type: rest
    namespace: rest-countries-lookup-rest
    port: 8080
    description: REST adapter mirroring the REST Countries v3.1 surface.
    resources:
    - path: /v3.1/all
      name: all
      description: REST surface for /all.
      operations:
      - method: GET
        name: listAllCountries
        description: List all countries.
        call: rest-countries-lookup.listAllCountries
        with:
          fields: rest.fields
        outputParameters:
        - type: array
          mapping: $.
    - path: /v3.1/name/{name}
      name: name
      description: REST surface for /name/{name}.
      operations:
      - method: GET
        name: getCountriesByName
        description: Search countries by name.
        call: rest-countries-lookup.getCountriesByName
        with:
          name: rest.name
          fullText: rest.fullText
        outputParameters:
        - type: array
          mapping: $.
    - path: /v3.1/alpha/{code}
      name: alpha-code
      description: REST surface for /alpha/{code}.
      operations:
      - method: GET
        name: getCountryByAlphaCode
        description: Get country by alpha code.
        call: rest-countries-lookup.getCountryByAlphaCode
        with:
          code: rest.code
        outputParameters:
        - type: array
          mapping: $.
    - path: /v3.1/region/{region}
      name: region
      description: REST surface for /region/{region}.
      operations:
      - method: GET
        name: getCountriesByRegion
        description: Filter countries by UN region.
        call: rest-countries-lookup.getCountriesByRegion
        with:
          region: rest.region
        outputParameters:
        - type: array
          mapping: $.
  - type: mcp
    namespace: rest-countries-lookup-mcp
    port: 9090
    transport: http
    description: MCP adapter for REST Countries lookup. One tool per consumed operation.
    tools:
    - name: list-all-countries
      description: List all countries (fields required).
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.listAllCountries
      with:
        fields: tools.fields
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-name
      description: Search countries by common or official name.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesByName
      with:
        name: tools.name
        fullText: tools.fullText
      outputParameters:
      - type: array
        mapping: $.
    - name: get-country-by-alpha-code
      description: Get country by ISO 3166-1 code.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountryByAlphaCode
      with:
        code: tools.code
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-currency
      description: Search countries by currency code or name.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesByCurrency
      with:
        currency: tools.currency
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-language
      description: Search countries by language code or name.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesByLanguage
      with:
        language: tools.language
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-capital
      description: Search countries by capital city.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesByCapital
      with:
        capital: tools.capital
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-region
      description: Filter countries by UN region.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesByRegion
      with:
        region: tools.region
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-subregion
      description: Filter countries by UN subregion.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesBySubregion
      with:
        subregion: tools.subregion
      outputParameters:
      - type: array
        mapping: $.
    - name: get-countries-by-translation
      description: Search countries by translated name.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.getCountriesByTranslation
      with:
        translation: tools.translation
      outputParameters:
      - type: array
        mapping: $.
    - name: list-independent-countries
      description: Filter countries by independence status.
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: rest-countries-lookup.listIndependentCountries
      with:
        status: tools.status
      outputParameters:
      - type: array
        mapping: $.