{
  "openapi": "3.0.3",
  "info": {
    "title": "UK Global Talent Visa — MCP REST surface",
    "description": "OpenAPI 3.0 wrapper around the Global Talent MCP server (https://ukglobaltalentvisa.org/mcp). The native transport is JSON-RPC 2.0 (Claude Desktop, Gemini, Perplexity); this REST surface exists for ChatGPT Custom GPT Actions, which only consume OpenAPI. Both call the same backend tools (search_handbook, get_endorser, compare_visas, estimate_cost, score_draft, apply_now_url, generate_personal_statement, random_success_story, criterion_breakdown, compare_my_chances).",
    "version": "1.0.0",
    "contact": {
      "name": "Global Talent AI",
      "url": "https://ukglobaltalentvisa.org/mcp"
    },
    "license": {
      "name": "CC-BY-4.0 (content) / proprietary (scoring)",
      "url": "https://ukglobaltalentvisa.org/mcp"
    }
  },
  "servers": [
    {
      "url": "https://ukglobaltalentvisa.org/mcp/rest",
      "description": "Production REST bridge — wraps each call in a JSON-RPC tools/call envelope and forwards to the MCP backend."
    }
  ],
  "security": [],
  "paths": {
    "/tools/search_handbook": {
      "post": {
        "operationId": "search_handbook",
        "summary": "Search the Global Talent Handbook",
        "description": "Full-text search across the five-chapter Global Talent Handbook. Returns the most relevant chapter passages with links back to ukglobaltalentvisa.org/faq.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["query"],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Natural-language question about the visa."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20,
                    "default": 5,
                    "description": "Maximum number of passages to return."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/get_endorser": {
      "post": {
        "operationId": "get_endorser",
        "summary": "Look up endorser criteria",
        "description": "Returns criteria, typical turnaround, and evidence patterns for a given endorsing body or sub-route (e.g. digital-technology/exceptional-talent, academia/royal-society, arts/film-tv).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["route_slug"],
                "properties": {
                  "route_slug": {
                    "type": "string",
                    "description": "Endorser or sub-route slug.",
                    "enum": [
                      "digital-technology",
                      "digital-technology/exceptional-talent",
                      "digital-technology/exceptional-promise",
                      "academia",
                      "academia/royal-society",
                      "academia/british-academy",
                      "academia/raeng",
                      "academia/ukri-fast-track",
                      "academia/peer-review",
                      "arts",
                      "arts/film-tv",
                      "arts/fashion",
                      "arts/architecture",
                      "arts/music-literature-visual"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/compare_visas": {
      "post": {
        "operationId": "compare_visas",
        "summary": "Compare Global Talent to another visa",
        "description": "Side-by-side comparison of the UK Global Talent visa against another immigration route.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["other"],
                "properties": {
                  "other": {
                    "type": "string",
                    "description": "Comparison target visa.",
                    "enum": [
                      "skilled-worker",
                      "o1",
                      "innovator-founder",
                      "eb1a",
                      "eb2-eb3",
                      "h1b",
                      "l1",
                      "graduate-visa",
                      "uae-golden-visa",
                      "singapore-employment-pass",
                      "australia-858",
                      "canada-express-entry",
                      "canada-startup-visa",
                      "ireland-critical-skills",
                      "japan-highly-skilled-professional",
                      "hong-kong-techtas",
                      "new-zealand-skilled-migrant",
                      "saudi-premium-residency",
                      "spain-digital-nomad",
                      "portugal-d8",
                      "eb5",
                      "france-tech-visa",
                      "germany-chancenkarte",
                      "germany-blue-card",
                      "eu-blue-card",
                      "netherlands-hsm",
                      "eu-digital-nomad-visas",
                      "uk-vs-eu-tech-visas"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/estimate_cost": {
      "post": {
        "operationId": "estimate_cost",
        "summary": "Estimate Global Talent visa cost",
        "description": "Returns a GBP line-by-line cost breakdown for a Global Talent application (endorsement + visa fee + IHS + optional fast-track), scaled by family size and visa length.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["route", "years"],
                "properties": {
                  "route": {
                    "type": "string",
                    "description": "Which endorsing-body route.",
                    "enum": ["tech", "academia", "arts"]
                  },
                  "years": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "description": "Visa length in years."
                  },
                  "adults": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2,
                    "default": 1,
                    "description": "Number of adult applicants (main + partner)."
                  },
                  "children": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 6,
                    "default": 0,
                    "description": "Number of dependent children."
                  },
                  "priority": {
                    "type": "boolean",
                    "default": false,
                    "description": "Include the optional fast-track service fee (tech / academia only)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/score_draft": {
      "post": {
        "operationId": "score_draft",
        "summary": "Grade a draft Global Talent application",
        "description": "Grades a draft application against the four Tech Nation criteria (Recognition, Innovation, Impact, Contribution). Returns A+ through F with per-criterion rationale. Free and anonymous.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["form_data"],
                "properties": {
                  "form_data": {
                    "type": "object",
                    "description": "Free-form application data. Include any of: fullName, cvText, awards, publications, patents, mediaRecognition, otherAchievements, supportingDocuments, references.",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/apply_now_url": {
      "post": {
        "operationId": "apply_now_url",
        "summary": "Return the canonical apply URL",
        "description": "Returns the canonical URL to begin a UK Global Talent Visa draft, optionally tagged with a referral source. Use as the start-draft CTA after an agent has helped a user evaluate their profile.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "referral": {
                    "type": "string",
                    "description": "Optional source/referral tag (e.g. \"chatgpt\", \"perplexity\", or a campaign name). Letters, digits, hyphen, underscore only; truncated to 64 chars."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/generate_personal_statement": {
      "post": {
        "operationId": "generate_personal_statement",
        "summary": "Draft a Global Talent personal statement",
        "description": "Drafts a UK Global Talent Visa personal statement (~800-1000 words) from a CV summary and chosen route, mapped to the four endorsement criteria. Free and anonymous; rate-limited to 3/day per IP.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["cv_summary"],
                "properties": {
                  "cv_summary": {
                    "type": "string",
                    "description": "The applicant's CV text or career summary. The more specific (named roles, awards, metrics), the stronger the draft."
                  },
                  "route": {
                    "type": "string",
                    "enum": ["tech", "academia", "arts"],
                    "description": "Endorsement route. Defaults to \"tech\" if omitted."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "429": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/random_success_story": {
      "post": {
        "operationId": "random_success_story",
        "summary": "Return a public-record success story",
        "description": "Returns one public-record UK Global Talent Visa success story (name, role, route, endorsement year, paraphrased bio) sourced from Tech Nation's published profiles.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/criterion_breakdown": {
      "post": {
        "operationId": "criterion_breakdown",
        "summary": "Break down the endorsement criteria",
        "description": "Explains one or all four UK Global Talent endorsement criteria (C1 Recognition, C2 Innovation, C3 Impact, C4 Contribution): what reviewers want, the evidence that works, and the common mistake for each. Pass an optional profile for a tailored read. Free and anonymous; rate-limited to 25/day per IP.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "criterion": {
                    "type": "string",
                    "enum": ["all", "C1", "C2", "C3", "C4", "recognition", "innovation", "impact", "contribution"],
                    "default": "all",
                    "description": "Which criterion to break down. Defaults to \"all\"."
                  },
                  "route": {
                    "type": "string",
                    "enum": ["tech", "academia", "arts"],
                    "default": "tech",
                    "description": "Endorsement route to frame the analysis. Defaults to \"tech\"."
                  },
                  "profile": {
                    "type": "string",
                    "description": "Optional summary of the applicant's background and evidence for a tailored read."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "429": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    },
    "/tools/compare_my_chances": {
      "post": {
        "operationId": "compare_my_chances",
        "summary": "Assess chances and get an action plan",
        "description": "Assesses how a draft UK Global Talent profile maps to the four criteria and returns a candid readiness verdict, per-criterion grades, the single biggest gap, and a prioritised list of concrete next steps. More verbose and action-oriented than score_draft. Free and anonymous; rate-limited to 15/day per IP.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["form_data"],
                "properties": {
                  "form_data": {
                    "type": "object",
                    "description": "The applicant's profile. Include any of: fullName, cvText, awards, publications, patents, mediaRecognition, otherAchievements, supportingDocuments, references.",
                    "additionalProperties": true
                  },
                  "route": {
                    "type": "string",
                    "enum": ["tech", "academia", "arts"],
                    "default": "tech",
                    "description": "Endorsement route to assess against. Defaults to \"tech\"."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/ToolResult" },
          "400": { "$ref": "#/components/responses/ToolError" },
          "429": { "$ref": "#/components/responses/ToolError" },
          "502": { "$ref": "#/components/responses/ToolError" }
        }
      }
    }
  },
  "components": {
    "responses": {
      "ToolResult": {
        "description": "Markdown-formatted tool result, flattened from the MCP `content` array.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ToolResult" }
          }
        }
      },
      "ToolError": {
        "description": "Tool error.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ToolError" }
          }
        }
      }
    },
    "schemas": {
      "ToolResult": {
        "type": "object",
        "required": ["text"],
        "properties": {
          "text": {
            "type": "string",
            "description": "Markdown body — pass straight through to the user."
          },
          "isError": {
            "type": "boolean",
            "description": "True when the backend returned a recoverable tool error (e.g. unknown route_slug). The status code stays 200 so ChatGPT can still surface the message to the user."
          }
        }
      },
      "ToolError": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "type": "string" }
        }
      }
    }
  }
}
