get_tides
Retrieve tide information for a specific location and date by providing latitude, longitude, and date to access detailed tide data including high/low tides and station details.
Instructions
Get tide information for a specific location and date.
Args:
latitude: Float value representing the location's latitude
longitude: Float value representing the location's longitude
date: Date string in YYYY-MM-DD format
Returns:
Formatted string containing tide information and station details
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | ||
| longitude | Yes | ||
| date | Yes |
Implementation Reference
- src/surf/tools.py:12-24 (handler)The handler function for the 'get_tides' tool. It is registered via the @mcp.tool() decorator and executes the tool logic by delegating to StormGlassAPI.@mcp.tool() async def get_tides(latitude: float, longitude: float, date: str) -> str: """Get tide information for a specific location and date. Args: latitude: Float value representing the location's latitude longitude: Float value representing the location's longitude date: Date string in YYYY-MM-DD format Returns: Formatted string containing tide information and station details """ return await api.get_tide_data(latitude, longitude, date)
- src/surf/stormglass_api.py:63-80 (helper)Supporting utility in StormGlassAPI class that performs the actual API request to retrieve tide data, formats parameters, handles the HTTP call, and returns formatted tide information.async def get_tide_data(self, latitude: float, longitude: float, date: str) -> str: """Get tide information for a specific location and date.""" url = f"{self.api_base}/tide/extremes/point" params = { "lat": latitude, "lng": longitude, "start": f"{date}T00:00:00Z", "end": f"{date}T23:59:59Z" } param_string = "&".join(f"{k}={v}" for k, v in params.items()) full_url = f"{url}?{param_string}" data = await self.make_request(full_url) if not data: return "Unable to fetch tide data for this location." return self.format_tide_data(data)
- src/surf/server.py:11-11 (registration)Execution of the MCP server, making the registered 'get_tides' tool available via stdio transport.mcp.run(transport='stdio')