{
  "openapi": "3.1.0",
  "info": {
    "title": "Bradford Operations agent API",
    "version": "1.0.0",
    "summary": "Find out what Bradford Operations can do for footage or a film, and which looks fit.",
    "description": "Public, read-only, no key. Ask in plain words (q) what you want done; get the matching services (status, price, next steps) and Glitch/Textures looks with before/after samples. Jobs (cloud renders, DCP) are not in this API yet: see https://www.bradfordoperations.com/software/agents. A request for something Bradford does not offer returns matched: false.",
    "contact": {
      "name": "Bradford Operations",
      "email": "hello@bradfordoperations.com",
      "url": "https://www.bradfordoperations.com/software/agents"
    }
  },
  "servers": [
    {
      "url": "https://www.bradfordoperations.com"
    }
  ],
  "externalDocs": {
    "url": "https://www.bradfordoperations.com/software/agents"
  },
  "paths": {
    "/api/public/agents/services": {
      "get": {
        "operationId": "listServices",
        "summary": "What Bradford offers, or what fits a request",
        "description": "Without q: every service and interface with its status and price. With q: the inquiry answer for those words.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2000
            },
            "example": "I want to make a DCP"
          }
        ],
        "responses": {
          "200": {
            "description": "Services, or the inquiry answer",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Catalog"
                    },
                    {
                      "$ref": "#/components/schemas/Inquiry"
                    }
                  ]
                }
              }
            }
          },
          "405": {
            "description": "Not GET"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/public/agents/looks": {
      "get": {
        "operationId": "findLooks",
        "summary": "The looks gallery, or the looks that fit some direction words",
        "description": "Without q: every look (the same document as https://www.bradfordoperations.com/agents/looks.json). With q: the looks whose direction words match, best first.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 500
            },
            "example": "worn VHS tape"
          },
          {
            "name": "product",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "glitch",
                "textures"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Looks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Looks"
                }
              }
            }
          },
          "400": {
            "description": "Unknown product or bad limit"
          },
          "405": {
            "description": "Not GET"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/a2a": {
      "post": {
        "operationId": "a2aJsonRpc",
        "summary": "A2A agent (JSON-RPC; protocol 1.0 SendMessage, and 0.3 message/send)",
        "description": "The agent described by https://www.bradfordoperations.com/.well-known/agent-card.json. Send a text message; the reply is a message with the answer as text and the inquiry as data.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response (errors are JSON-RPC errors with HTTP 200)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "mcpStreamableHttp",
        "summary": "The one Bradford MCP (streamable HTTP, stateless, JSON responses)",
        "description": "Signed out: find_services, find_looks, get_look (read-only, no key). Signed in with OAuth (resource https://www.bradfordoperations.com/api/mcp) or a Bradford API key: also the Lab tools (read-only, free), the DCP service's tools, and the Bradford Toolkit and Frame.io tools when the key carries them. A member tool called signed out answers 401 with the OAuth challenge.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "integer",
                      "null"
                    ]
                  },
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification accepted"
          },
          "401": {
            "description": "Sign in: a member tool called signed out, or a credential that is not valid (WWW-Authenticate names the OAuth metadata)"
          },
          "403": {
            "description": "Signed in, but this tool's door refuses the caller (scope, membership)"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Service": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "summary",
          "page",
          "how"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "glitch-looks",
              "textures-looks",
              "dcp-mastering",
              "post-production-services"
            ]
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "opening",
              "coming"
            ],
            "description": "available: can be had now; opening: made, not on sale yet; coming: planned."
          },
          "summary": {
            "type": "string"
          },
          "page": {
            "type": "string",
            "format": "uri"
          },
          "pricing": {
            "type": "object"
          },
          "licenseOnSale": {
            "type": "boolean",
            "description": "Plugins only: whether the license can be bought right now."
          },
          "how": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "LookMatch": {
        "type": "object",
        "required": [
          "id",
          "name",
          "does"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "does": {
            "type": "string"
          },
          "matched": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "after": {
            "type": "string",
            "format": "uri"
          },
          "before": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Inquiry": {
        "type": "object",
        "required": [
          "request",
          "matched",
          "services",
          "looks",
          "answer"
        ],
        "properties": {
          "request": {
            "type": "string"
          },
          "matched": {
            "type": "boolean",
            "description": "false when Bradford does not offer what was asked; services is then empty."
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            }
          },
          "looks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LookMatch"
            }
          },
          "answer": {
            "type": "string"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          },
          "contact": {
            "type": "string",
            "format": "email"
          }
        }
      },
      "Catalog": {
        "type": "object",
        "required": [
          "services",
          "interfaces"
        ],
        "properties": {
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            }
          },
          "interfaces": {
            "type": "object"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Looks": {
        "type": "object",
        "required": [
          "schema",
          "looks"
        ],
        "properties": {
          "schema": {
            "type": "string"
          },
          "matched": {
            "type": "boolean"
          },
          "looks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "effects": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}
