{
  "openapi": "3.1.0",
  "info": {
    "title": "Glintbase Agent Readiness & MCP API",
    "version": "3.3.0",
    "description": "Canonical programmatic interface and machine entrypoints for Glintbase — Agent Readiness Infrastructure (ARS 3.3). Powers autonomous AI coding agents (Claude Code, Cursor, Windsurf), CI/CD quality gates, and developer platforms to audit, benchmark, simulate, and remediate agent operability across software surfaces. No authentication is required on any endpoint; limits are per IP (see https://glintbase.dev/auth.md).",
    "contact": {
      "name": "Glintbase Developer Infrastructure Desk",
      "url": "https://glintbase.dev/support",
      "email": "contact@glintbase.dev"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://glintbase.dev",
      "description": "glintbase.dev"
    },
    {
      "url": "https://scan.glintbase.dev",
      "description": "Glintbase scanner"
    }
  ],
  "paths": {
    "/api/mcp": {
      "post": {
        "operationId": "callMcpMethod",
        "summary": "Execute Model Context Protocol (MCP) JSON-RPC 2.0 Request",
        "description": "Official MCP streamable server entrypoint implementing JSON-RPC 2.0. Dispatches protocol lifecycle methods (initialize, tools/list, tools/call) to the 5 hosted Glintbase tools (glintbase_audit, glintbase_get_score, glintbase_discover_surfaces, glintbase_simulate_flight, glintbase_get_skill).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpJsonRpcRequest"
              },
              "examples": {
                "simulateFlight": {
                  "summary": "Simulate Claude Code flight",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": "req-1",
                    "method": "tools/call",
                    "params": {
                      "name": "glintbase_simulate_flight",
                      "arguments": {
                        "target": "https://docs.stripe.com",
                        "persona": "claude-code",
                        "intent": "Create customer and attach payment method"
                      }
                    }
                  }
                },
                "audit": {
                  "summary": "Run ARS 3.3 audit",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": "req-2",
                    "method": "tools/call",
                    "params": {
                      "name": "glintbase_audit",
                      "arguments": {
                        "target": "https://docs.stripe.com"
                      }
                    }
                  }
                },
                "listTools": {
                  "summary": "List the hosted tools",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": "req-0",
                    "method": "tools/list",
                    "params": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Standard JSON-RPC 2.0 response containing tool output content blocks and structured telemetry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit-Minute": {
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining-Minute": {
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (60 requests/min sliding window per IP)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpJsonRpcErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Upstream MCP server unavailable (glintbase.dev proxy only)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -X POST https://glintbase.dev/api/mcp \\n  -H \"Content-Type: application/json\" \\n  -H \"Accept: application/json, text/event-stream\" \\n  -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"glintbase_get_score\",\"arguments\":{\"target\":\"https://docs.stripe.com\"}}}'"
          }
        ]
      },
      "get": {
        "operationId": "subscribeMcpSseStream",
        "summary": "Subscribe to Streamable HTTP Server-Sent Events (SSE) Stream",
        "description": "Establishes a persistent bidirectional Server-Sent Events stream for remote AI agents and IDEs. Emits 'endpoint' discovery events and real-time tool execution progress.",
        "responses": {
          "200": {
            "description": "Active Server-Sent Events stream",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "example": "event: endpoint\ndata: https://scan.glintbase.dev/api/mcp\n\n"
                }
              }
            }
          },
          "502": {
            "description": "Upstream MCP server unavailable (glintbase.dev proxy only)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -N -H \"Accept: text/event-stream\" https://glintbase.dev/api/mcp"
          }
        ]
      },
      "servers": [
        {
          "url": "https://scan.glintbase.dev",
          "description": "Glintbase scanner (origin)"
        },
        {
          "url": "https://glintbase.dev",
          "description": "glintbase.dev proxy"
        }
      ]
    },
    "/api/simulate": {
      "post": {
        "operationId": "runFlightSimulator",
        "summary": "Run an agent journey simulation (streams NDJSON)",
        "description": "Evaluates how real AI coding personas (claude-code, cursor, perplexity) navigate, ingest documentation, resolve parameters, and execute tools against your target software surface. Emits Token Tax ($/M), Schema Friction Index, SVG journey tree, and compressed visual replay URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SimulateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stream of events: init, step events, then complete {result} or error {message}.",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string",
                  "description": "One JSON event per line."
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or target URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit: 5 simulations per hour per IP",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -N -X POST https://scan.glintbase.dev/api/simulate \\n  -H \"Content-Type: application/json\" \\n  -d '{\"target\":\"https://docs.stripe.com\",\"intent\":\"Find how to authenticate\",\"harness\":\"claude-code\"}'"
          }
        ]
      },
      "servers": [
        {
          "url": "https://scan.glintbase.dev",
          "description": "Glintbase scanner"
        }
      ]
    },
    "/api/scan": {
      "post": {
        "operationId": "triggerArsScan",
        "summary": "Run an ARS 3.3 scan (streams NDJSON)",
        "description": "Triggers a full 137-check ARS 3.3 evaluation across 4 operational layers (Discovery, Access, Usability, Payments) using dynamic denominator scaling.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stream of progress events, then complete {score, grade, score_version, scorecard, scanId} or error {message, code}.",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string",
                  "description": "One JSON event per line."
                }
              }
            }
          },
          "400": {
            "description": "Invalid body or URL (including private-network targets)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit: 5 scans per hour per IP, or server busy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -N -X POST https://scan.glintbase.dev/api/scan \\n  -H \"Content-Type: application/json\" \\n  -d '{\"url\":\"https://docs.anthropic.com\"}'"
          }
        ]
      },
      "servers": [
        {
          "url": "https://scan.glintbase.dev",
          "description": "Glintbase scanner"
        }
      ]
    },
    "/api/v1/sandbox": {
      "post": {
        "operationId": "runSandboxScan",
        "summary": "Run a live ARS scan via the hosted MCP glintbase_get_score tool",
        "description": "Public ephemeral sandbox environment allowing autonomous agents to test API queries, schema parsing, and mock payloads with synthetic responses and zero risk.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetUrl"
                ],
                "properties": {
                  "targetUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Live score card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "scannedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "result": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid target URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Scanner unavailable or scan did not complete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -X POST https://glintbase.dev/api/v1/sandbox \\n  -H \"Content-Type: application/json\" \\n  -d '{\"targetUrl\":\"https://docs.stripe.com\"}'"
          }
        ]
      },
      "servers": [
        {
          "url": "https://glintbase.dev",
          "description": "glintbase.dev"
        }
      ],
      "get": {
        "summary": "Same as POST, with the target in ?url=",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Live score card",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "source": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    },
                    "scannedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "result": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid target URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Scanner unavailable or scan did not complete",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "operationId": "getSandboxScan",
        "description": "Runs the same live scan as POST /api/v1/sandbox, with the target URL in the `url` query parameter. No authentication.",
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl \"https://glintbase.dev/api/v1/sandbox?url=https://docs.stripe.com\""
          }
        ]
      }
    },
    "/api/waitlist": {
      "post": {
        "operationId": "joinWaitlist",
        "summary": "Register for early access waitlist",
        "description": "Adds an email address to the Glintbase early access ledger. Idempotent on duplicate registration.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signup stored"
          },
          "400": {
            "description": "Invalid email or body",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Email already on the waitlist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Signup could not be stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Waitlist temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -X POST https://glintbase.dev/api/waitlist \\n  -H \"Content-Type: application/json\" \\n  -d '{\"email\":\"you@example.com\"}'"
          }
        ]
      },
      "servers": [
        {
          "url": "https://glintbase.dev",
          "description": "glintbase.dev"
        }
      ]
    },
    "/api/enterprise": {
      "post": {
        "operationId": "requestEnterpriseAssessment",
        "summary": "Request Enterprise Agent Readiness Assessment",
        "description": "Submits organizational details for custom enterprise readiness auditing and CI PR drift gating setup.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "fullName",
                  "company",
                  "workEmail",
                  "role"
                ],
                "properties": {
                  "fullName": {
                    "type": "string"
                  },
                  "company": {
                    "type": "string"
                  },
                  "workEmail": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "orgSize": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  },
                  "aiUsage": {
                    "type": "string"
                  },
                  "challenge": {
                    "type": "string"
                  },
                  "newsletter": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request stored (alreadySubmitted: true for duplicates)"
          },
          "400": {
            "description": "Missing or invalid fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "description": "Request could not be stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl -X POST https://glintbase.dev/api/enterprise \\n  -H \"Content-Type: application/json\" \\n  -d '{\"fullName\":\"Ada Lovelace\",\"company\":\"Example Inc\",\"workEmail\":\"ada@example.com\",\"role\":\"CTO\"}'"
          }
        ]
      },
      "servers": [
        {
          "url": "https://glintbase.dev",
          "description": "glintbase.dev"
        }
      ]
    },
    "/api/mcp/manifest": {
      "servers": [
        {
          "url": "https://glintbase.dev",
          "description": "glintbase.dev"
        }
      ],
      "get": {
        "operationId": "getMcpManifest",
        "summary": "Get the MCP server manifest",
        "description": "Name, version, icon, endpoint and tool list of the hosted Glintbase MCP server. The same document is served at /.well-known/mcp and /.well-known/mcp/manifest.json.",
        "responses": {
          "200": {
            "description": "MCP manifest",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "version",
                    "endpoint",
                    "tools"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "icon": {
                      "type": "string",
                      "format": "uri"
                    },
                    "endpoint": {
                      "type": "string",
                      "format": "uri"
                    },
                    "tools": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "curl",
            "source": "curl https://glintbase.dev/.well-known/mcp/manifest.json"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "McpJsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "type": [
              "string",
              "number"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "initialize",
              "tools/list",
              "tools/call",
              "ping",
              "notifications/initialized"
            ]
          },
          "params": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "MCP tool name (one of the 5 hosted tools)"
              },
              "arguments": {
                "type": "object",
                "description": "Tool-specific parameter payload"
              }
            }
          }
        }
      },
      "McpJsonRpcResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "result"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "type": [
              "string",
              "number"
            ]
          },
          "result": {
            "type": "object",
            "properties": {
              "content": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "text",
                        "image",
                        "resource"
                      ]
                    },
                    "text": {
                      "type": "string"
                    },
                    "data": {
                      "type": "string",
                      "description": "Base64 encoded payload"
                    },
                    "mimeType": {
                      "type": "string",
                      "example": "image/svg+xml"
                    }
                  }
                }
              },
              "structuredData": {
                "type": "object",
                "description": "Machine-readable telemetry payload"
              }
            }
          }
        }
      },
      "McpJsonRpcErrorResponse": {
        "type": "object",
        "required": [
          "jsonrpc",
          "id",
          "error"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "enum": [
              "2.0"
            ]
          },
          "id": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "integer"
              },
              "message": {
                "type": "string"
              },
              "data": {
                "type": "object"
              }
            }
          }
        }
      },
      "SimulateRequest": {
        "type": "object",
        "required": [
          "target"
        ],
        "properties": {
          "target": {
            "type": "string",
            "format": "uri",
            "description": "Target URL"
          },
          "intent": {
            "type": "string",
            "maxLength": 500
          },
          "harness": {
            "type": "string",
            "enum": [
              "claude-code",
              "cursor",
              "perplexity"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "e2b",
              "deterministic"
            ],
            "default": "e2b"
          }
        }
      },
      "ScanRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "options": {
            "type": "object",
            "properties": {
              "archetypeOverride": {
                "type": "string",
                "enum": [
                  "api_devtool",
                  "docs_kb",
                  "ecommerce",
                  "content_media"
                ],
                "description": "Scans with an override are not saved as the official score."
              },
              "enabledSurfaces": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
