openapi-mcp-server/docs/time.md
Tom Foster 719d4ecba4
All checks were successful
CI / Lint & Test (push) Successful in 23s
CI / Build and push Docker image (push) Successful in 1m22s
Update endpoint paths and lint codebase
2025-08-01 21:37:26 +01:00

1.9 KiB

Time Tool

A comprehensive time utilities tool providing secure time operations, timezone conversion, and time calculations.

Overview

The Time tool provides robust time-related functionality for the OpenAPI MCP Server, including current time retrieval, timezone conversions, Unix timestamp conversion, and timestamp parsing.

Endpoints

Method Endpoint Description
GET /time/get_time Get current time in any IANA timezone (defaults to UTC). Optional timezone parameter accepts IANA timezone names like 'America/New_York', 'Europe/London', etc.
POST /time/unix_to_iso Convert Unix epoch timestamp to ISO format. Accepts Unix timestamp (float) and optional target timezone.
POST /time/convert_time Convert timestamp from one timezone to another. Requires timestamp, source timezone, and target timezone.
POST /time/elapsed_time Calculate time difference between two timestamps. Returns difference in specified units (seconds, minutes, hours, days).
POST /time/parse_timestamp Parse flexible human-readable timestamps (e.g. 'June 1st 2024 3:30 PM', 'tomorrow at noon', '2024-06-01 15:30') into standardised UTC ISO format.
GET /time/list_time_zones Get list of all valid IANA timezone names for use with other endpoints.

Key Features

  • Flexible Input: Supports various timestamp formats and human-readable date strings
  • Timezone Aware: Full IANA timezone support with automatic conversions
  • Unix Compatibility: Convert Unix epoch timestamps to readable ISO format
  • Time Calculations: Calculate elapsed time between any two timestamps
  • Standardised Output: All timestamps returned in ISO 8601 format

Usage

The Time tool is automatically loaded by the OpenAPI MCP Server framework. All endpoints are available under the /time prefix when the server is running. Visit /docs for interactive API documentation.