{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/letsship-ai/json-schema/letsship-ai-mcp-binding-schema.json",
  "title": "McpBinding",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/letsship-ai-openapi.json#/components/schemas/McpBinding",
  "type": "object",
  "properties": {
    "transport": {
      "$ref": "#/$defs/McpBindingTransport"
    },
    "status": {
      "$ref": "#/$defs/McpBindingStatus"
    },
    "statusDetail": {
      "type": [
        "string",
        "null"
      ]
    },
    "roles": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/McpRole"
      }
    },
    "authKind": {
      "$ref": "#/$defs/McpAuthKind"
    },
    "pinnedUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "packageSpec": {
      "type": [
        "string",
        "null"
      ]
    },
    "allowedEgressHosts": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "credentialFields": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "toolSnapshot": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/McpToolSnapshotEntry"
      }
    },
    "approvedTools": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/McpApprovedTool"
      }
    },
    "toolsRefreshedAt": {
      "type": [
        "integer",
        "null"
      ]
    },
    "effectiveToolCounts": {
      "type": "object",
      "properties": {
        "planner": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            },
            {
              "type": "null"
            }
          ]
        },
        "builder": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            },
            {
              "type": "null"
            }
          ]
        },
        "reviewer": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            },
            {
              "type": "null"
            }
          ]
        },
        "qa": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "createdAt": {
      "type": "integer"
    },
    "updatedAt": {
      "type": "integer"
    }
  },
  "required": [
    "transport",
    "status",
    "statusDetail",
    "roles",
    "authKind",
    "pinnedUrl",
    "packageSpec",
    "allowedEgressHosts",
    "credentialFields",
    "toolSnapshot",
    "approvedTools",
    "toolsRefreshedAt",
    "effectiveToolCounts",
    "createdAt",
    "updatedAt"
  ],
  "$defs": {
    "McpApprovedTool": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "attestedReadOnly": {
          "type": "boolean"
        }
      },
      "required": [
        "name"
      ]
    },
    "McpAuthKind": {
      "type": "string",
      "enum": [
        "none",
        "headers",
        "oauth",
        "isolate-env"
      ]
    },
    "McpBindingStatus": {
      "type": "string",
      "enum": [
        "ready",
        "needs_credential",
        "needs_reconnect",
        "origin_changed",
        "bundling",
        "bundle_failed",
        "not_isolatable"
      ]
    },
    "McpBindingTransport": {
      "type": "string",
      "enum": [
        "remote",
        "isolate",
        "local"
      ],
      "description": "remote: the gateway proxies to the server's URL. isolate: the gateway runs the server's npm package in an isolated runtime. local: the server runs inside the agent's sandbox (no credential)."
    },
    "McpRole": {
      "type": "string",
      "enum": [
        "planner",
        "builder",
        "reviewer",
        "qa"
      ]
    },
    "McpToolSnapshotEntry": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "readOnlyHint": {
          "type": "boolean"
        },
        "destructiveHint": {
          "type": "boolean"
        }
      },
      "required": [
        "name"
      ]
    }
  }
}