{
  "openapi": "3.1.1",
  "info": {
    "title": "Skyfold Star Map Poster API",
    "version": "1.0.0",
    "summary": "Print the real night sky of any place and moment as an SVG or PDF poster.",
    "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://skyfoldstarmapposter.usefulweb.app"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Print the real night sky of any place and moment as an SVG or PDF poster.",
        "description": "Draws the stars to magnitude 6.5, constellation figures, the Moon and planets exactly as they stood above a place at a local date and time, in five print styles and seven paper sizes, as a vector SVG and PDF.\n\nMethodology:\n- Stars: every HYG v4.1 star to magnitude 6.5 (8 920 stars), precessed from J2000 to the date with nutation and annual aberration, then converted to azimuth and altitude with refraction.\n- Projection: zenithal stereographic, zenith in the centre and the horizon as the circle, north up and east on the left as seen when you look up.\n- Constellation figures from d3-celestial (BSD licence); Moon and planets from the Skyfold ephemeris. Dot sizes grow by a factor 1.38 per magnitude.\n- Vector output: the SVG and a one-page PDF at the paper size (standard PDF fonts).\n\nShows the geometric sky without clouds, light pollution or the Milky Way band; proper motions of stars are not applied. Texts outside the Latin-1 character set are replaced in the PDF (use the SVG instead).",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "skyfold_star_map_poster",
        "x-owner-app": "skyfold",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkyfoldStarMapPosterInput"
              },
              "examples": {
                "example1": {
                  "summary": "Paris, 14 June 2019, ivory print",
                  "value": {
                    "location": "48.8566, 2.3522",
                    "timeZone": "Europe/Paris",
                    "date": "2019-06-14",
                    "time": "23:30",
                    "style": "ivory",
                    "size": "a3",
                    "magLimit": 6,
                    "title": "The night we met",
                    "placeLabel": "Paris, France"
                  }
                },
                "example2": {
                  "summary": "Tokyo New Year sky, black and gold",
                  "value": {
                    "location": "35.6762, 139.6503",
                    "timeZone": "Asia/Tokyo",
                    "date": "2027-01-01",
                    "time": "00:00",
                    "style": "black",
                    "size": "square",
                    "magLimit": 5.5,
                    "title": "A new year begins",
                    "placeLabel": "Tokyo",
                    "starNames": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkyfoldStarMapPosterResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "SkyfoldStarMapPosterInput": {
        "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": "48.8566, 2.3522"
          },
          "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/Paris"
          },
          "date": {
            "title": "Local date",
            "type": "string",
            "format": "date",
            "default": "2019-06-14"
          },
          "time": {
            "title": "Local time",
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
            "default": "23:30"
          },
          "style": {
            "title": "Style",
            "type": "string",
            "enum": [
              "midnight",
              "ivory",
              "black",
              "blueprint",
              "red"
            ],
            "default": "midnight"
          },
          "size": {
            "title": "Paper size",
            "type": "string",
            "enum": [
              "a4",
              "a3",
              "a2",
              "letter",
              "in12x16",
              "in18x24",
              "square"
            ],
            "default": "a3"
          },
          "magLimit": {
            "title": "Faintest stars (magnitude)",
            "description": "Larger numbers show fainter stars; 6 to 6.5 is the naked-eye limit under a dark sky.",
            "type": "number",
            "minimum": 3,
            "maximum": 6.5,
            "default": 6
          },
          "title": {
            "title": "Title",
            "type": "string",
            "maxLength": 120,
            "default": "The night we met"
          },
          "subtitle": {
            "title": "Subtitle",
            "type": "string",
            "maxLength": 120,
            "default": ""
          },
          "placeLabel": {
            "title": "Place line",
            "type": "string",
            "maxLength": 120,
            "default": "Paris, France"
          },
          "dateLabel": {
            "title": "Date line",
            "description": "Leave blank to print the local date and time.",
            "type": "string",
            "maxLength": 120,
            "default": ""
          },
          "constellations": {
            "title": "Constellation lines",
            "type": "boolean",
            "default": true
          },
          "constellationNames": {
            "title": "Constellation names",
            "type": "boolean",
            "default": true
          },
          "starNames": {
            "title": "Names of the brightest stars",
            "type": "boolean",
            "default": false
          },
          "planets": {
            "title": "Moon and planets",
            "type": "boolean",
            "default": true
          },
          "colorStars": {
            "title": "Star colours from the B−V index",
            "type": "boolean",
            "default": false
          }
        },
        "required": []
      },
      "SkyfoldStarMapPosterResult": {
        "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"
              }
            }
          }
        }
      }
    }
  }
}