{
  "openapi": "3.1.0",
  "info": {
    "title": "RoyalMapper API",
    "version": "2.0.0",
    "description": "Provides genealogical data and multilingual support for GPT integrations with RoyalMapper."
  },
  "servers": [
    {
      "url": "https://royalmapper.com"
    }
  ],
  "paths": {
    "/api/mcp/getsupportedlanguages": {
      "get": {
        "operationId": "GetSupportedLanguages",
        "summary": "Returns supported language codes.",
        "responses": {
          "200": {
            "description": "List of language codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp/getperson": {
      "get": {
        "operationId": "GetPerson",
        "summary": "Retrieves information about a person.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Person GID or external ID."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Two-letter language code."
          }
        ],
        "responses": {
          "200": {
            "description": "Person data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp/getfamilytreeurl": {
      "get": {
        "operationId": "GetFamilyTreeUrl",
        "summary": "Returns a web URL for viewing a person\u0027s family tree.",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Person GID or external ID."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Two-letter language code."
          }
        ],
        "responses": {
          "200": {
            "description": "Family tree URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp/getfamilytree": {
      "post": {
        "operationId": "GetFamilyTree",
        "summary": "Returns a family tree for a person.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "PrimaryPersonId": {
                    "type": "string"
                  },
                  "lang": {
                    "type": "string"
                  },
                  "ancestors": {
                    "type": "integer"
                  },
                  "descendants": {
                    "type": "integer"
                  },
                  "showHalfSiblings": {
                    "type": "boolean"
                  },
                  "showInlaws": {
                    "type": "boolean"
                  },
                  "showPreviousSpouses": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "PrimaryPersonId",
                  "lang",
                  "ancestors",
                  "descendants"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Family tree data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/mcp/search": {
      "get": {
        "operationId": "Search",
        "summary": "Searches people by name.",
        "parameters": [
          {
            "name": "term",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search term."
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Two-letter language code."
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}