{
  "openapi": "3.1.1",
  "info": {
    "title": "Skyfold Printable Moon Calendar API",
    "version": "1.0.0",
    "summary": "A printable Moon calendar for any month or year: phases, moonrise, moonset, perigee and supermoons.",
    "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://skyfoldmooncalendar.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "A printable Moon calendar for any month or year: phases, moonrise, moonset, perigee and supermoons.",
        "description": "Draws the Moon of every day of a month or year for your place, with the illuminated fraction, moonrise and moonset in local time, the four principal phases, perigee and apogee with distances and the supermoons, as a print-ready PDF, SVG and PNG in 17 languages.\n\nMethodology:\n- Phase and illuminated fraction at local noon of each day from the Skyfold ephemeris (truncated ELP-2000/82 Moon, VSOP87 Sun); principal phases where the Moon–Sun elongation is 0°, 90°, 180° and 270°.\n- Moonrise and moonset: upper limb on an ideal horizon with 34′ of refraction, topocentric (U.S. Naval Observatory convention).\n- Perigee and apogee: extrema of the geocentric centre distance; 2026 values agree with published tables within 3 minutes and 15 km. Supermoon after R. Nolle: a full or new Moon within 10 % of the perigee end of that orbit’s distance range.\n- Layout, fonts and the PDF/SVG/PNG writers are Printshop’s (Noto fonts, Intl month and weekday names, right-to-left order for Arabic).\n\nMoonrise and moonset assume a flat horizon at sea level; hills and buildings delay rising and advance setting. The phase drawing shows the Moon as seen from the northern hemisphere, mirrored for southern places.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "skyfold_moon_calendar",
        "x-owner-app": "skyfold",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkyfoldMoonCalendarInput"
              },
              "examples": {
                "example1": {
                  "summary": "Berlin, January 2027, German",
                  "value": {
                    "location": "52.52, 13.405",
                    "timeZone": "Europe/Berlin",
                    "year": 2027,
                    "month": "1",
                    "layout": "month",
                    "lang": "de",
                    "paper": "a4",
                    "orientation": "portrait",
                    "weekStart": "auto",
                    "placeLabel": "Berlin"
                  }
                },
                "example2": {
                  "summary": "Cape Town, the whole of 2027 on one landscape page",
                  "value": {
                    "location": "-33.9249, 18.4241",
                    "timeZone": "Africa/Johannesburg",
                    "year": 2027,
                    "month": "0",
                    "layout": "year",
                    "lang": "en",
                    "paper": "a4",
                    "orientation": "landscape",
                    "weekStart": "mon",
                    "placeLabel": "Cape Town"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkyfoldMoonCalendarResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "SkyfoldMoonCalendarInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "location": {
            "title": "Location (latitude, longitude)",
            "description": "Decimal degrees such as 52.09, 5.12 (north and east positive), or DMS, UTM, MGRS, Maidenhead or a plus code.",
            "type": "string",
            "maxLength": 80,
            "default": "52.52, 13.405"
          },
          "elevation": {
            "title": "Elevation above sea level",
            "type": "number",
            "minimum": -500,
            "maximum": 9000,
            "default": 0,
            "x-unit": "m"
          },
          "timeZone": {
            "title": "Time zone",
            "description": "IANA name such as Europe/Berlin or America/New_York, or a fixed offset such as UTC+2.",
            "type": "string",
            "maxLength": 64,
            "default": "Europe/Berlin"
          },
          "year": {
            "title": "Year",
            "type": "integer",
            "minimum": 1900,
            "maximum": 2100,
            "default": 2027
          },
          "month": {
            "title": "Month",
            "type": "string",
            "enum": [
              "0",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "12"
            ],
            "default": "0"
          },
          "layout": {
            "title": "Layout",
            "type": "string",
            "enum": [
              "month",
              "year"
            ],
            "default": "month"
          },
          "lang": {
            "title": "Language of the calendar",
            "type": "string",
            "enum": [
              "en",
              "de",
              "fr",
              "es",
              "it",
              "pt",
              "nl",
              "pl",
              "tr",
              "ru",
              "uk",
              "ar",
              "hi",
              "zh",
              "ja",
              "ko",
              "id"
            ],
            "default": "en"
          },
          "paper": {
            "title": "Paper size",
            "type": "string",
            "enum": [
              "a4",
              "a3",
              "letter",
              "tabloid"
            ],
            "default": "a4"
          },
          "orientation": {
            "title": "Orientation",
            "type": "string",
            "enum": [
              "portrait",
              "landscape"
            ],
            "default": "portrait"
          },
          "weekStart": {
            "title": "Week starts on",
            "type": "string",
            "enum": [
              "auto",
              "mon",
              "sun",
              "sat"
            ],
            "default": "auto"
          },
          "placeLabel": {
            "title": "Place line",
            "type": "string",
            "maxLength": 80,
            "default": "Berlin"
          }
        },
        "required": []
      },
      "SkyfoldMoonCalendarResult": {
        "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"
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}