{
  "openapi": "3.1.0",
  "info": {
    "title": "BPM Tapper site lookup API",
    "version": "1.0.0",
    "description": "Read-only lookup over the public tool catalog of tapbpmnow.com. It returns which page on the site fits a stated task. It performs no audio analysis and exposes no write operations.",
    "license": {
      "name": "MIT"
    }
  },
  "servers": [
    {
      "url": "https://tapbpmnow.com"
    }
  ],
  "paths": {
    "/api/agent/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "List or search the public tool catalog",
        "description": "Returns catalog records. With no query, returns the whole catalog. With q, matches the visitor's words against each record's title, heading, description and id.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Free-text task or instrument name, for example \"bass tuner\" or \"tap tempo\"."
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "instrument-tuner",
                "pitch-tool",
                "tempo-tool",
                "harmony-tool",
                "site-info",
                "home"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog records. An empty matches array means nothing on the site fits the query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/agent/tools/{id}": {
      "get": {
        "operationId": "getTool",
        "summary": "Read one catalog record by its stable id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Stable tool id, for example \"bass-tuner\"."
          }
        ],
        "responses": {
          "200": {
            "description": "The record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tool"
                }
              }
            }
          },
          "404": {
            "description": "No such tool id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Tool": {
        "type": "object",
        "required": [
          "id",
          "url",
          "category",
          "title",
          "description"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable identifier; the page slug, or \"home\" for the homepage."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Canonical URL of the page."
          },
          "category": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "heading": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ToolList": {
        "type": "object",
        "required": [
          "origin",
          "count",
          "matches"
        ],
        "properties": {
          "origin": {
            "type": "string",
            "format": "uri"
          },
          "source": {
            "type": "string",
            "format": "uri",
            "description": "Canonical catalog URL."
          },
          "query": {
            "type": [
              "string",
              "null"
            ]
          },
          "count": {
            "type": "integer",
            "description": "Number of records in matches."
          },
          "total": {
            "type": "integer",
            "description": "Number of records in the full catalog."
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tool"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  }
}
