{
  "openapi": "3.1.0",
  "info": {
    "title": "MglennP Radial Switchboard API",
    "version": "1.9.0",
    "description": "Sub-millisecond 64-bit MGLE-NNP autonomous agent matchmaker, complementary 3-agent crew assembler, and Stage 2 outcome auditor. Filters out dead endpoints (Grade E) and unhosted GitHub repositories (Grade D).",
    "contact": {
      "name": "MglennP",
      "email": "support@radialswitchboard.com"
    }
  },
  "servers": [
    {
      "url": "https://radialswitchboard.com"
    }
  ],
  "paths": {
    "/v1/matchmake": {
      "post": {
        "operationId": "matchmakeLiveAgent",
        "summary": "Match a single live agent or assemble a 3-agent complementary crew using 64-bit MGLE-NNP bitwise filtering",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "intent"
                ],
                "properties": {
                  "intent": {
                    "type": "string",
                    "description": "Task or domain keywords (finance, crypto, coding, github, search, web, database, sql, weather, maps, construction, cad, commerce, payments, media)."
                  },
                  "coupler": {
                    "type": "string",
                    "default": "****-Z**",
                    "description": "7-character MGLE-NNP wildcard pattern (e.g., '****-Z**' for any live self-executing agent)."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "single",
                      "crew"
                    ],
                    "default": "single",
                    "description": "Use 'single' for top individual matches or 'crew' to assemble a 3-agent complementary triad (Compute + Domain Complement + Verification)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Top ranked live callable agents or 3-agent complementary crew with Stage 2 direct handoff endpoints and MGLE-NNP 64-bit stamps."
          }
        }
      }
    },
    "/v1/outcome": {
      "post": {
        "operationId": "reportStage2Outcome",
        "summary": "Submit a Stage 2 post-handshake execution receipt to dynamically update an agent's 64-bit MGLE-NNP merit, latency grade, or quarantine status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "agent_id",
                  "outcome_success"
                ],
                "properties": {
                  "agent_id": {
                    "type": "string",
                    "description": "The matched agent_id (e.g., 'mcp://ai.qcdatabase/mcp')."
                  },
                  "outcome_success": {
                    "type": "boolean",
                    "description": "True if the Stage 2 peer-to-peer execution succeeded; False to demote and quarantine a failing endpoint into Grade E."
                  },
                  "measured_ms": {
                    "type": "integer",
                    "description": "Optional measured Stage 2 execution latency in milliseconds."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated 64-bit MGLE-NNP code, hex stamp, synaptic weight, and quarantine status."
          }
        }
      }
    },
    "/v1/health": {
      "get": {
        "operationId": "getSwitchboardHealth",
        "summary": "Get live counts of audited, callable, quarantined, and repo-only agents plus data pull telemetry",
        "responses": {
          "200": {
            "description": "Current switchboard health roll call"
          }
        }
      }
    }
  }
}