{"openapi":"3.1.0","info":{"title":"Country State City (BYOK) API","version":"0.1.0","description":"Country State City (BYOK) lets an AI assistant read your own Country State City data through the Country State City API with a key you supply (Country State City API key). Read-only: 10 tools (list_countries, get_country, list_states, get_state, list_cities_in_state, list_cities_in_country, get_postcode, get_country_timezone, get_state_timezone, get_data_version). The BYOK key travels with each...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-countrystatecity.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-countrystatecity/docs"},"termsOfService":"https://connectorbay.com/byok-countrystatecity/terms"},"servers":[{"url":"https://byok-countrystatecity.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-countrystatecity/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_countries":{"post":{"operationId":"list_countries","summary":"List all countries with ISO codes, phone code, capital, currency, region and coordinates; optionally filter by a name se","description":"List all countries with ISO codes, phone code, capital, currency, region and coordinates; optionally filter by a name search. Available on every plan. Use for \"Which countries have 'land' in their name\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Case-insensitive name search, for example 'india'.","title":"Search"}},"title":"list_countriesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_country":{"post":{"operationId":"get_country","summary":"Get one country by ISO2 code: codes, capital, currency, native name, region, subregion, coordinates and its timezone lis","description":"Get one country by ISO2 code: codes, capital, currency, native name, region, subregion, coordinates and its timezone list. Use for \"What is the capital, currency and dial code of India\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'IN' or 'US'.","maxLength":3,"title":"Country Code","type":"string"}},"required":["country_code"],"title":"get_countryArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_states":{"post":{"operationId":"list_states","summary":"List the states, provinces or regions of a country with their codes and coordinates; optionally filter by name. Use for ","description":"List the states, provinces or regions of a country with their codes and coordinates; optionally filter by name. Use for \"List the states of India\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'IN' or 'US'.","maxLength":3,"title":"Country Code","type":"string"},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Case-insensitive state name search, for example 'maha'.","title":"Search"}},"required":["country_code"],"title":"list_statesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_state":{"post":{"operationId":"get_state","summary":"Get one state or province by country and state code: name, code, coordinates and timezone. Use for \"Give me details of t","description":"Get one state or province by country and state code: name, code, coordinates and timezone. Use for \"Give me details of the state MH in India\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'IN' or 'US'.","maxLength":3,"title":"Country Code","type":"string"},"state_code":{"description":"State or province code within the country (the iso2 field of a state), for example 'MH'.","maxLength":10,"title":"State Code","type":"string"}},"required":["country_code","state_code"],"title":"get_stateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_cities_in_state":{"post":{"operationId":"list_cities_in_state","summary":"List the cities of one state, optionally filtered by name or kind. Basic plans return id, name and kind; higher plans ad","description":"List the cities of one state, optionally filtered by name or kind. Basic plans return id, name and kind; higher plans add coordinates and timezone. Use for \"Which cities in Maharashtra start with 'pun'\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'IN' or 'US'.","maxLength":3,"title":"Country Code","type":"string"},"state_code":{"description":"State or province code within the country (the iso2 field of a state), for example 'MH'.","maxLength":10,"title":"State Code","type":"string"},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Case-insensitive city name search, for example 'pune'.","title":"Search"},"kind":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Restrict to a kind of place, for example 'settlement'.","title":"Kind"}},"required":["country_code","state_code"],"title":"list_cities_in_stateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_cities_in_country":{"post":{"operationId":"list_cities_in_country","summary":"List all cities of a country (Starter plan or above), optionally filtered by name or kind. Large countries return thousa","description":"List all cities of a country (Starter plan or above), optionally filtered by name or kind. Large countries return thousands of rows, so search by name. Use for \"Find cities named Springfield in the United States\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'IN' or 'US'.","maxLength":3,"title":"Country Code","type":"string"},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Case-insensitive city name search, for example 'springfield'.","title":"Search"},"kind":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Restrict to a kind of place, for example 'settlement'.","title":"Kind"}},"required":["country_code"],"title":"list_cities_in_countryArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_postcode":{"post":{"operationId":"get_postcode","summary":"Check a postcode within a country and list every matching locality record (code, locality name, state code, type). An em","description":"Check a postcode within a country and list every matching locality record (code, locality name, state code, type). An empty match is a 404. Use for \"Which locality has postcode 11104 in Sri Lanka\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'LK'.","maxLength":3,"title":"Country Code","type":"string"},"postcode":{"description":"The exact postcode or ZIP code to look up.","maxLength":20,"title":"Postcode","type":"string"}},"required":["country_code","postcode"],"title":"get_postcodeArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_country_timezone":{"post":{"operationId":"get_country_timezone","summary":"Get the main IANA timezone of a country (its capital's zone), with UTC offsets and whether daylight saving applies right","description":"Get the main IANA timezone of a country (its capital's zone), with UTC offsets and whether daylight saving applies right now. Use for \"What timezone does India use\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'IN' or 'US'.","maxLength":3,"title":"Country Code","type":"string"}},"required":["country_code"],"title":"get_country_timezoneArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_state_timezone":{"post":{"operationId":"get_state_timezone","summary":"Get the IANA timezone of a state or province, with UTC offsets and current daylight saving status. Useful for countries ","description":"Get the IANA timezone of a state or province, with UTC offsets and current daylight saving status. Useful for countries with several zones. Use for \"What timezone is California in right now\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"country_code":{"description":"Two-letter ISO 3166-1 country code, for example 'US'.","maxLength":3,"title":"Country Code","type":"string"},"state_code":{"description":"State code within the country, for example 'CA'.","maxLength":10,"title":"State Code","type":"string"}},"required":["country_code","state_code"],"title":"get_state_timezoneArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_data_version":{"post":{"operationId":"get_data_version","summary":"Show which release of the geographic dataset the API serves, when it was imported and how many regions, countries, state","description":"Show which release of the geographic dataset the API serves, when it was imported and how many regions, countries, states and cities it holds. Use for \"How current is the Country State City dataset\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_data_versionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}