{
  "openapi": "3.1.0",
  "info": {
    "title": "Star Wars Name Generator — MCP REST",
    "version": "0.1.0",
    "summary": "OpenAPI spec for the MCP invoke-tool REST dispatcher so clients can auto-generate typed request/response models.",
    "description": "REST access to the Star Wars Name Generator MCP server. Every tool is callable over plain HTTP at `/.mcp/invoke-tool/<tool>` with a JSON body, and discoverable at `/.mcp/list-tools`. Public, stateless, no API key. Trademark: Star Wars™ is property of Lucasfilm Ltd. / The Walt Disney Company. Unaffiliated fan project.",
    "contact": {
      "name": "Star Wars Name Generator",
      "url": "https://starwarsnamegenerator.com/contact",
      "email": "contact@starwarsnamegenerator.com"
    }
  },
  "externalDocs": {
    "description": "MCP tool documentation with copy-pastable examples",
    "url": "https://starwarsnamegenerator.com/mcp-docs"
  },
  "servers": [
    {
      "url": "https://vqcjvexnwxnwvaoeofka.supabase.co/functions/v1/mcp",
      "description": "Production MCP endpoint (Supabase Edge Function)"
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "Discover tools and their input schemas"
    },
    {
      "name": "Tools",
      "description": "Invoke individual name-generation tools"
    }
  ],
  "paths": {
    "/.mcp/list-tools": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "summary": "List available MCP tools",
        "description": "Returns every tool exposed by the MCP server along with its JSON Schema input definition. Use this to discover tool names and argument shapes at runtime.",
        "operationId": "listMcpTools",
        "responses": {
          "200": {
            "description": "Tool catalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListToolsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/.mcp/invoke-tool/list_star_wars_species": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "List Star Wars Species",
        "description": "List the species ids supported by generate_star_wars_name, with their display names. Call this before generating character names.",
        "operationId": "invoke_list_star_wars_species",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListStarWarsSpeciesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListStarWarsSpeciesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large (max 256 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (120 req/min or burst limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          }
        }
      }
    },
    "/.mcp/invoke-tool/generate_star_wars_name": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Generate Star Wars Name",
        "description": "Generate authentic-sounding Star Wars character names for a given species, gender, and era. Use list_star_wars_species first to see valid species ids.",
        "operationId": "invoke_generate_star_wars_name",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateStarWarsNameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateStarWarsNameResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large (max 256 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (120 req/min or burst limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          }
        }
      }
    },
    "/.mcp/invoke-tool/generate_droid_name": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Generate Droid Name",
        "description": "Generate Star Wars droid designations by class: astromech (R2-D2 / BB-8 serials), protocol (C-3PO / K-2SO blocks), or battle (OOM-9 / IG-88 / HK-47 series).",
        "operationId": "invoke_generate_droid_name",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateDroidNameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateDroidNameResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large (max 256 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (120 req/min or burst limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          }
        }
      }
    },
    "/.mcp/invoke-tool/generate_ship_name": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Generate Ship Name",
        "description": "Generate Star Wars starship names — from smuggler freighters to Imperial capital ships.",
        "operationId": "invoke_generate_ship_name",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateShipNameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerateShipNameResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large (max 256 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (120 req/min or burst limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          }
        }
      }
    },
    "/.mcp/invoke-tool/generate_planet_name": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Generate Planet Name",
        "description": "Generate Star Wars planet and world names in the style of Coruscant, Tatooine, and Naboo.",
        "operationId": "invoke_generate_planet_name",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneratePlanetNameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratePlanetNameResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "413": {
            "description": "Request body too large (max 256 KB)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (120 req/min or burst limit)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ToolContentBlock": {
        "type": "object",
        "description": "A single MCP content block. Text blocks carry the human-readable result.",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "description": "Content block type."
          },
          "text": {
            "type": "string",
            "description": "Newline-separated generated values."
          }
        },
        "required": [
          "type",
          "text"
        ]
      },
      "ToolError": {
        "type": "object",
        "description": "Returned when a request is rejected (bad args, rate limit, oversized body).",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message."
          }
        },
        "required": [
          "error"
        ]
      },
      "ListToolsResponse": {
        "type": "object",
        "description": "The catalog of tools this MCP server exposes, with their input schemas.",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "inputSchema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "required": [
                "name",
                "description"
              ]
            }
          }
        },
        "required": [
          "tools"
        ]
      },
      "ListStarWarsSpeciesRequest": {
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "ListStarWarsSpeciesResponse": {
        "type": "object",
        "description": "Result of list_star_wars_species.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolContentBlock"
            }
          },
          "structuredContent": {
            "type": "object",
            "properties": {
              "species": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name"
                  ]
                }
              }
            },
            "required": [
              "species"
            ]
          },
          "isError": {
            "type": "boolean",
            "description": "Present and true when the call failed."
          }
        },
        "required": [
          "content"
        ]
      },
      "GenerateStarWarsNameRequest": {
        "type": "object",
        "properties": {
          "species": {
            "type": "string",
            "enum": [
              "human",
              "twilek",
              "wookiee",
              "zabrak",
              "mandalorian",
              "sith",
              "jedi",
              "hutt",
              "rodian",
              "moncalamari",
              "chiss",
              "togruta",
              "gamorrean"
            ],
            "description": "Species id, e.g. human, jedi, sith, mandalorian, twilek, wookiee."
          },
          "gender": {
            "description": "Gender styling (male, female, neutral). Applies to human, jedi, mandalorian. Default neutral.",
            "type": "string",
            "enum": [
              "male",
              "female",
              "neutral"
            ]
          },
          "era": {
            "description": "Galactic era flavor: old-republic, clone-wars, imperial, new-republic. Default imperial.",
            "type": "string",
            "enum": [
              "old-republic",
              "clone-wars",
              "imperial",
              "new-republic"
            ]
          },
          "count": {
            "description": "How many names to generate (1-50). Default 6.",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": [
          "species"
        ]
      },
      "GenerateStarWarsNameResponse": {
        "type": "object",
        "description": "Result of generate_star_wars_name.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolContentBlock"
            }
          },
          "structuredContent": {
            "type": "object",
            "properties": {
              "species": {
                "type": "string"
              },
              "gender": {
                "type": "string"
              },
              "era": {
                "type": "string"
              },
              "names": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "names"
            ]
          },
          "isError": {
            "type": "boolean",
            "description": "Present and true when the call failed."
          }
        },
        "required": [
          "content"
        ]
      },
      "GenerateDroidNameRequest": {
        "type": "object",
        "properties": {
          "droidClass": {
            "type": "string",
            "enum": [
              "astromech",
              "protocol",
              "battle"
            ],
            "description": "Droid class: astromech, protocol, or battle."
          },
          "count": {
            "description": "How many designations to generate (1-50). Default 6.",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": [
          "droidClass"
        ]
      },
      "GenerateDroidNameResponse": {
        "type": "object",
        "description": "Result of generate_droid_name.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolContentBlock"
            }
          },
          "structuredContent": {
            "type": "object",
            "properties": {
              "droidClass": {
                "type": "string"
              },
              "names": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "names"
            ]
          },
          "isError": {
            "type": "boolean",
            "description": "Present and true when the call failed."
          }
        },
        "required": [
          "content"
        ]
      },
      "GenerateShipNameRequest": {
        "type": "object",
        "properties": {
          "count": {
            "description": "How many ship names to generate (1-50). Default 6.",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        }
      },
      "GenerateShipNameResponse": {
        "type": "object",
        "description": "Result of generate_ship_name.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolContentBlock"
            }
          },
          "structuredContent": {
            "type": "object",
            "properties": {
              "names": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "names"
            ]
          },
          "isError": {
            "type": "boolean",
            "description": "Present and true when the call failed."
          }
        },
        "required": [
          "content"
        ]
      },
      "GeneratePlanetNameRequest": {
        "type": "object",
        "properties": {
          "count": {
            "description": "How many planet names to generate (1-50). Default 6.",
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        }
      },
      "GeneratePlanetNameResponse": {
        "type": "object",
        "description": "Result of generate_planet_name.",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ToolContentBlock"
            }
          },
          "structuredContent": {
            "type": "object",
            "properties": {
              "names": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "names"
            ]
          },
          "isError": {
            "type": "boolean",
            "description": "Present and true when the call failed."
          }
        },
        "required": [
          "content"
        ]
      }
    }
  }
}
