get_timezone

Pack: geonames · Endpoint: https://gateway.pipeworx.io/geonames/mcp

Get timezone information for a latitude/longitude location. Returns timezone ID, GMT offset, DST offset, current local time, sunrise, and sunset. Example: get_timezone(40.7128, -74.0060) for New York.

Parameters

NameTypeRequiredDescription
_apiKeystringyesGeoNames username
latnumberyesLatitude (e.g., 40.7128)
lngnumberyesLongitude (e.g., -74.0060)

Example call

Arguments

{
  "_apiKey": "your-geonames-api-key",
  "lat": 40.7128,
  "lng": -74.006
}

curl

curl -X POST https://gateway.pipeworx.io/geonames/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_timezone","arguments":{"_apiKey":"your-geonames-api-key","lat":40.7128,"lng":-74.006}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('get_timezone', {
  "_apiKey": "your-geonames-api-key",
  "lat": 40.7128,
  "lng": -74.006
});

Response shape

Always returns: timezone_id, gmt_offset, raw_offset, dst_offset, current_time, sunrise, sunset, country_code, country_name, latitude, longitude

FieldTypeDescription
timezone_idstring | nullIANA timezone identifier
gmt_offsetnumber | nullCurrent GMT offset in hours
raw_offsetnumber | nullRaw offset from GMT
dst_offsetnumber | nullDaylight saving time offset
current_timestring | nullCurrent local time at location
sunrisestring | nullSunrise time
sunsetstring | nullSunset time
country_codestring | nullISO country code
country_namestring | nullFull country name
latitudenumberLatitude coordinate
longitudenumberLongitude coordinate
Full JSON Schema
{
  "type": "object",
  "properties": {
    "timezone_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "IANA timezone identifier"
    },
    "gmt_offset": {
      "type": [
        "number",
        "null"
      ],
      "description": "Current GMT offset in hours"
    },
    "raw_offset": {
      "type": [
        "number",
        "null"
      ],
      "description": "Raw offset from GMT"
    },
    "dst_offset": {
      "type": [
        "number",
        "null"
      ],
      "description": "Daylight saving time offset"
    },
    "current_time": {
      "type": [
        "string",
        "null"
      ],
      "description": "Current local time at location"
    },
    "sunrise": {
      "type": [
        "string",
        "null"
      ],
      "description": "Sunrise time"
    },
    "sunset": {
      "type": [
        "string",
        "null"
      ],
      "description": "Sunset time"
    },
    "country_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO country code"
    },
    "country_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Full country name"
    },
    "latitude": {
      "type": "number",
      "description": "Latitude coordinate"
    },
    "longitude": {
      "type": "number",
      "description": "Longitude coordinate"
    }
  },
  "required": [
    "timezone_id",
    "gmt_offset",
    "raw_offset",
    "dst_offset",
    "current_time",
    "sunrise",
    "sunset",
    "country_code",
    "country_name",
    "latitude",
    "longitude"
  ]
}

Connect

Add this to your MCP client config, or use one-click install buttons:

{
  "mcpServers": {
    "geonames": {
      "url": "https://gateway.pipeworx.io/geonames/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build May 9, 2026