{
  "openapi": "3.1.0",
  "info": {
    "title": "Sell with Goodell API",
    "version": "1.0.0",
    "description": "Agent- and developer-facing surface for sellwithgoodell.com: an MCP server, discovery endpoints, Markdown content negotiation, and the contact/CPE form endpoints. For conversational access, connect an MCP client to /mcp.",
    "contact": { "name": "Sell with Goodell", "email": "lauren@sellwithgoodell.com", "url": "https://sellwithgoodell.com" }
  },
  "servers": [{ "url": "https://sellwithgoodell.com" }],
  "paths": {
    "/mcp": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "MCP server (Streamable HTTP, stateless)",
        "description": "Model Context Protocol endpoint. Send JSON-RPC 2.0 messages (initialize, tools/list, tools/call, ping). Verb-first tools: list_offerings, get_offering, get_speaker_profile, list_media, get_contact_info.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/JsonRpcRequest" },
              "examples": {
                "tools/list": { "value": { "jsonrpc": "2.0", "id": 1, "method": "tools/list" } },
                "get_offering": { "value": { "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "get_offering", "arguments": { "slug": "keynotes" } } } }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "JSON-RPC response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonRpcResponse" } } } },
          "202": { "description": "Accepted (notification, no body)" }
        }
      },
      "get": {
        "operationId": "mcpInfo",
        "summary": "MCP server info",
        "description": "Stateless server: GET returns server info and declines SSE (use POST).",
        "responses": { "405": { "description": "Method Not Allowed — use POST", "content": { "application/json": {} } } }
      }
    },
    "/.well-known/mcp-server-card": {
      "get": {
        "operationId": "getMcpServerCard",
        "summary": "MCP server card",
        "description": "Machine-readable description of the MCP server (endpoint, capabilities, tools).",
        "responses": { "200": { "description": "Server card", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/McpServerCard" } } } } }
      }
    },
    "/": {
      "get": {
        "operationId": "getHome",
        "summary": "Homepage (HTML or Markdown)",
        "description": "Returns the web app as HTML. Send 'Accept: text/markdown' to receive a clean Markdown rendering for LLMs and agents.",
        "parameters": [{ "name": "Accept", "in": "header", "required": false, "schema": { "type": "string", "enum": ["text/html", "text/markdown"] } }],
        "responses": {
          "200": {
            "description": "Page content",
            "content": {
              "text/html": { "schema": { "type": "string" } },
              "text/markdown": { "schema": { "type": "string" } }
            }
          }
        }
      }
    },
    "/{slug}": {
      "get": {
        "operationId": "getOfferingPage",
        "summary": "Offering page (HTML or Markdown)",
        "description": "Detail page for an offering. Send 'Accept: text/markdown' for a Markdown rendering.",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string", "enum": ["keynotes", "growth-intensive", "gtm-cohort", "advisory", "accelerator-pod", "cpe", "media", "contact"] } },
          { "name": "Accept", "in": "header", "required": false, "schema": { "type": "string", "enum": ["text/html", "text/markdown"] } }
        ],
        "responses": {
          "200": { "description": "Page content", "content": { "text/html": { "schema": { "type": "string" } }, "text/markdown": { "schema": { "type": "string" } } } },
          "404": { "description": "Unknown page" }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "submitContact",
        "summary": "Submit the contact form",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContactForm" } } } },
        "responses": {
          "200": { "description": "Sent", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResult" } } } },
          "400": { "description": "Missing required fields", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResult" } } } },
          "502": { "description": "Email delivery failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResult" } } } }
        }
      }
    },
    "/api/cpe": {
      "post": {
        "operationId": "submitCpeRequest",
        "summary": "Request CPE-eligible training info",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CpeForm" } } } },
        "responses": {
          "200": { "description": "Sent", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResult" } } } },
          "400": { "description": "Validation error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResult" } } } }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "JsonRpcRequest": {
        "type": "object",
        "required": ["jsonrpc", "method"],
        "properties": {
          "jsonrpc": { "type": "string", "const": "2.0" },
          "id": { "type": ["string", "number", "null"] },
          "method": { "type": "string", "examples": ["initialize", "tools/list", "tools/call", "ping"] },
          "params": { "type": "object" }
        }
      },
      "JsonRpcResponse": {
        "type": "object",
        "required": ["jsonrpc"],
        "properties": {
          "jsonrpc": { "type": "string", "const": "2.0" },
          "id": { "type": ["string", "number", "null"] },
          "result": { "type": "object" },
          "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } } }
        }
      },
      "McpServerCard": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "title": { "type": "string" },
          "description": { "type": "string" },
          "version": { "type": "string" },
          "protocolVersion": { "type": "string" },
          "transport": { "type": "string" },
          "endpoint": { "type": "string", "format": "uri" },
          "capabilities": { "type": "object" },
          "tools": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } }
        }
      },
      "ContactForm": {
        "type": "object",
        "required": ["name", "email", "message"],
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "company": { "type": "string" },
          "message": { "type": "string" }
        }
      },
      "CpeForm": {
        "type": "object",
        "required": ["fullName", "email", "firmName"],
        "properties": {
          "fullName": { "type": "string", "maxLength": 100 },
          "email": { "type": "string", "format": "email", "maxLength": 255 },
          "firmName": { "type": "string", "maxLength": 200 },
          "roleTitle": { "type": "string", "maxLength": 100 },
          "firmSize": { "type": "string" },
          "trainingTypes": { "type": "array", "items": { "type": "string" } },
          "cpeInterest": { "type": "string" },
          "additionalInfo": { "type": "string", "maxLength": 1000 }
        }
      },
      "SuccessResult": { "type": "object", "properties": { "success": { "type": "boolean" } } },
      "ErrorResult": { "type": "object", "properties": { "error": { "type": "string" }, "detail": { "type": "string" } } }
    }
  }
}
