{
  "openapi": "3.1.1",
  "info": {
    "title": "Focus Room World Clock API",
    "version": "1.0.0",
    "summary": "Local times, UTC offsets and daylight saving in several cities, plus the best meeting hours.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://focusroomworldclock.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Local times, UTC offsets and daylight saving in several cities, plus the best meeting hours.",
        "description": "Shows one moment on the clocks of up to twelve time zones — local date and time, weekday, UTC offset, daylight saving and the day difference — as a table and as analogue clock faces, then plans a meeting: for each hour of the day it lists how many places are inside their working hours, so you can see at a glance when everyone is at work. The Focus Room app shows the same clocks as a live world-clock strip.\n\nMethodology:\n- Local times, offsets and weekdays come from the IANA time-zone database through the platform’s Intl implementation. Daylight saving time = the zone’s offset at that moment is above the smaller of its January and July offsets that year.\n- Day difference = local date of the zone minus the local date of the first zone.\n- Meeting planner: the day of the moment in the first zone is split into its 24 local hours; an hour counts for a place when that whole hour lies inside the working hours on a Monday to Friday there. Best hours are those with the highest count.\n- Clock faces are drawn with rotated lines only (hour hand 30° per hour plus 0.5° per minute, minute hand 6° per minute), so every device draws the same picture.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "focusroom_world_clock",
        "x-owner-app": "focusroom",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FocusroomWorldClockInput"
              },
              "examples": {
                "example1": {
                  "summary": "Berlin, New York and Tokyo on a Monday morning in December",
                  "value": {
                    "zones": [
                      "Europe/Berlin",
                      "America/New_York",
                      "Asia/Tokyo"
                    ],
                    "at": "2026-12-21T09:00",
                    "atZone": "Europe/Berlin"
                  }
                },
                "example2": {
                  "summary": "A distributed team: San Francisco, London, Kolkata and Sydney",
                  "value": {
                    "zones": [
                      "America/Los_Angeles",
                      "Europe/London",
                      "Asia/Kolkata",
                      "Australia/Sydney"
                    ],
                    "at": "2027-04-06T16:00",
                    "atZone": "UTC",
                    "workStart": 8,
                    "workEnd": 18
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FocusroomWorldClockResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FocusroomWorldClockInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "zones": {
            "title": "Time zones",
            "description": "One IANA name per line; the first one is the reference for day differences and the meeting planner.",
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 12,
            "default": [
              "Europe/Berlin",
              "America/New_York",
              "Asia/Tokyo"
            ]
          },
          "at": {
            "title": "Moment (optional)",
            "description": "Empty = now (rounded down to the minute). Local date-time YYYY-MM-DDTHH:mm",
            "type": "string"
          },
          "atZone": {
            "title": "Time zone of that moment",
            "description": "IANA time-zone name such as Europe/Berlin, America/New_York, Asia/Kolkata or UTC.",
            "type": "string",
            "maxLength": 64,
            "default": "UTC"
          },
          "workStart": {
            "title": "Working hours start",
            "type": "integer",
            "minimum": 0,
            "maximum": 23,
            "default": 9,
            "x-unit": "h"
          },
          "workEnd": {
            "title": "Working hours end",
            "type": "integer",
            "minimum": 1,
            "maximum": 24,
            "default": 17,
            "x-unit": "h"
          }
        },
        "required": []
      },
      "FocusroomWorldClockResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "utc",
              "rows",
              "meetingDate",
              "bestHours",
              "bestCount",
              "hours"
            ],
            "properties": {
              "utc": {
                "type": "string"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "zone",
                    "city",
                    "local",
                    "weekday",
                    "offset",
                    "dst",
                    "dayShift",
                    "workHours"
                  ],
                  "properties": {
                    "zone": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "local": {
                      "type": "string"
                    },
                    "weekday": {
                      "type": "string"
                    },
                    "offset": {
                      "type": "string"
                    },
                    "dst": {
                      "type": "boolean"
                    },
                    "dayShift": {
                      "type": "integer"
                    },
                    "workHours": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "meetingDate": {
                "type": "string",
                "description": "Local date (first zone) of the planned day."
              },
              "bestHours": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Start times (first zone) of the hours with the most places inside working hours."
              },
              "bestCount": {
                "type": "integer"
              },
              "hours": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "utc",
                    "local",
                    "inside"
                  ],
                  "properties": {
                    "utc": {
                      "type": "string"
                    },
                    "local": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "inside": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}