Country State City API · Capability

Country State City API — Cities

Country State City API — Cities. 4 operations. Lead operation: List all cities. Self-contained Naftiko capability covering one Country State City Api business surface.

Run with Naftiko Country State City ApiCities

What You Can Do

GET
Listcities — List all cities
/v1/cities
GET
Listcitiesbycountry — List cities for a country
/v1/countries/{ciso}/cities
GET
Listcitiesbycountryandstate — List cities in a country and state
/v1/countries/{ciso}/states/{siso}/cities
GET
Listcitiesbystate — List cities for a state by numeric state id
/v1/states/{sid}/cities

MCP Tools

list-all-cities

List all cities

read-only idempotent
list-cities-country

List cities for a country

read-only idempotent
list-cities-country-and-state

List cities in a country and state

read-only idempotent
list-cities-state-numeric-state

List cities for a state by numeric state id

read-only idempotent

Capability Spec

country-state-city-cities.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Country State City API — Cities
  description: 'Country State City API — Cities. 4 operations. Lead operation: List all cities. Self-contained Naftiko capability
    covering one Country State City Api business surface.'
  tags:
  - Country State City Api
  - Cities
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    COUNTRY_STATE_CITY_API_API_KEY: COUNTRY_STATE_CITY_API_API_KEY
capability:
  consumes:
  - type: http
    namespace: country-state-city-cities
    baseUri: https://api.countrystatecity.in/v1
    description: Country State City API — Cities business capability. Self-contained, no shared references.
    resources:
    - name: cities
      path: /cities
      operations:
      - name: listcities
        method: GET
        description: List all cities
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: countries-ciso-cities
      path: /countries/{ciso}/cities
      operations:
      - name: listcitiesbycountry
        method: GET
        description: List cities for a country
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ciso
          in: path
          type: string
          required: true
    - name: countries-ciso-states-siso-cities
      path: /countries/{ciso}/states/{siso}/cities
      operations:
      - name: listcitiesbycountryandstate
        method: GET
        description: List cities in a country and state
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: ciso
          in: path
          type: string
          required: true
        - name: siso
          in: path
          type: string
          required: true
    - name: states-sid-cities
      path: /states/{sid}/cities
      operations:
      - name: listcitiesbystate
        method: GET
        description: List cities for a state by numeric state id
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: sid
          in: path
          type: integer
          description: Numeric state identifier.
          required: true
    authentication:
      type: apikey
      key: X-CSCAPI-KEY
      value: '{{env.COUNTRY_STATE_CITY_API_API_KEY}}'
      placement: header
  exposes:
  - type: rest
    namespace: country-state-city-cities-rest
    port: 8080
    description: REST adapter for Country State City API — Cities. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/cities
      name: cities
      description: REST surface for cities.
      operations:
      - method: GET
        name: listcities
        description: List all cities
        call: country-state-city-cities.listcities
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/countries/{ciso}/cities
      name: countries-ciso-cities
      description: REST surface for countries-ciso-cities.
      operations:
      - method: GET
        name: listcitiesbycountry
        description: List cities for a country
        call: country-state-city-cities.listcitiesbycountry
        with:
          ciso: rest.ciso
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/countries/{ciso}/states/{siso}/cities
      name: countries-ciso-states-siso-cities
      description: REST surface for countries-ciso-states-siso-cities.
      operations:
      - method: GET
        name: listcitiesbycountryandstate
        description: List cities in a country and state
        call: country-state-city-cities.listcitiesbycountryandstate
        with:
          ciso: rest.ciso
          siso: rest.siso
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/states/{sid}/cities
      name: states-sid-cities
      description: REST surface for states-sid-cities.
      operations:
      - method: GET
        name: listcitiesbystate
        description: List cities for a state by numeric state id
        call: country-state-city-cities.listcitiesbystate
        with:
          sid: rest.sid
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: country-state-city-cities-mcp
    port: 9090
    transport: http
    description: MCP adapter for Country State City API — Cities. One tool per consumed operation, routed inline through this
      capability's consumes block.
    tools:
    - name: list-all-cities
      description: List all cities
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: country-state-city-cities.listcities
      outputParameters:
      - type: object
        mapping: $.
    - name: list-cities-country
      description: List cities for a country
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: country-state-city-cities.listcitiesbycountry
      with:
        ciso: tools.ciso
      outputParameters:
      - type: object
        mapping: $.
    - name: list-cities-country-and-state
      description: List cities in a country and state
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: country-state-city-cities.listcitiesbycountryandstate
      with:
        ciso: tools.ciso
        siso: tools.siso
      outputParameters:
      - type: object
        mapping: $.
    - name: list-cities-state-numeric-state
      description: List cities for a state by numeric state id
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: country-state-city-cities.listcitiesbystate
      with:
        sid: tools.sid
      outputParameters:
      - type: object
        mapping: $.