get_sunrise_sunset
Pack: geo · Endpoint: https://gateway.pipeworx.io/geo/mcp
Get sunrise/sunset times for a location by coordinates or city name. Returns exact times, daylight duration, and twilight times. Use for activity planning or astronomical data.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
latitude | number | yes | Latitude |
longitude | number | yes | Longitude |
date | string | no | Date in YYYY-MM-DD format (default: today) |
Example call
Arguments
{
"latitude": 40.7128,
"longitude": -74.006
}
curl
curl -X POST https://gateway.pipeworx.io/geo/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_sunrise_sunset","arguments":{"latitude":40.7128,"longitude":-74.006}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_sunrise_sunset', {
"latitude": 40.7128,
"longitude": -74.006
});
More examples
{
"latitude": 35.6762,
"longitude": 139.6503,
"date": "2024-06-21"
}
Response shape
Always returns: sunrise, sunset, solar_noon, day_length_seconds, civil_twilight_begin, civil_twilight_end
| Field | Type | Description |
|---|---|---|
sunrise | string | Sunrise time in ISO format |
sunset | string | Sunset time in ISO format |
solar_noon | string | Solar noon time in ISO format |
day_length_seconds | number | Total daylight duration in seconds |
civil_twilight_begin | string | Civil twilight start time in ISO format |
civil_twilight_end | string | Civil twilight end time in ISO format |
Full JSON Schema
{
"type": "object",
"properties": {
"sunrise": {
"type": "string",
"description": "Sunrise time in ISO format"
},
"sunset": {
"type": "string",
"description": "Sunset time in ISO format"
},
"solar_noon": {
"type": "string",
"description": "Solar noon time in ISO format"
},
"day_length_seconds": {
"type": "number",
"description": "Total daylight duration in seconds"
},
"civil_twilight_begin": {
"type": "string",
"description": "Civil twilight start time in ISO format"
},
"civil_twilight_end": {
"type": "string",
"description": "Civil twilight end time in ISO format"
}
},
"required": [
"sunrise",
"sunset",
"solar_noon",
"day_length_seconds",
"civil_twilight_begin",
"civil_twilight_end"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"geo": {
"url": "https://gateway.pipeworx.io/geo/mcp"
}
}
}
See Getting Started for client-specific install steps.