{
  "openapi": "3.0.3",
  "info": {
    "title": "HornLib — Official Public REST & MCP API",
    "version": "1.0.3",
    "description": "HornLib is an interactive French Horn acoustic laboratory and digital practice workbench compliant with ISO 16:1975 pitch standards and International Horn Society (IHS) notation rules. Players and educators can query 46-note F/Bb double horn rotary valve fingerings, transpose historical orchestral crooks (Eb, D, C, G, A, E), analyze natural overtone cent deviations, and practice standard symphony audition excerpts. Built for conservatory students, band directors, and orchestral hornists worldwide, available in English, Chinese, German, and Japanese with free web, CLI, and MCP agent access.",
    "contact": {
      "name": "HornLib",
      "url": "https://hornlib.com",
      "email": "admin@hornlib.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "externalDocs": {
    "description": "HornLib Official Web Workbench",
    "url": "https://hornlib.com"
  },
  "servers": [
    {
      "url": "https://hornlib.com",
      "description": "Production Cloudflare Global Edge"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Optional API Key for Albato / automation tracking (e.g. pk_live_hornlib_2026)"
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/api/v1/me": {
      "get": {
        "operationId": "verifyApiConnection",
        "summary": "Verify HornLib API Key & Service Health",
        "description": "Authentication test and metadata endpoint for Albato App Integrator, RapidAPI, Make, and custom workflows.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "responses": {
          "200": {
            "description": "Authenticated connection status and tool count",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "example": true
                    },
                    "authenticated": {
                      "type": "boolean",
                      "example": true
                    },
                    "service": {
                      "type": "string",
                      "example": "HornLib"
                    },
                    "domain": {
                      "type": "string",
                      "example": "hornlib.com"
                    },
                    "version": {
                      "type": "string",
                      "example": "1.0.3"
                    },
                    "toolsCount": {
                      "type": "integer",
                      "example": 8
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools": {
      "get": {
        "operationId": "listAvailableTools",
        "summary": "List All HornLib Read-Only Tools & Schemas",
        "responses": {
          "200": {
            "description": "Array of available read-only tools"
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "operationId": "getMcpServerMetadata",
        "summary": "Get HornLib MCP Server Metadata",
        "responses": {
          "200": {
            "description": "MCP Server metadata and Grade-A tool annotations"
          }
        }
      },
      "post": {
        "operationId": "invokeMcpJsonRpc",
        "summary": "Execute Streamable HTTP JSON-RPC 2.0 MCP Request",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "id",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "example": "2.0"
                  },
                  "id": {
                    "type": "integer",
                    "example": 1
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "initialize",
                      "tools/list",
                      "tools/call"
                    ],
                    "example": "tools/list"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response envelope"
          }
        }
      }
    },
    "/api/v1/tools/lookup_french_horn_fingering": {
      "post": {
        "operationId": "lookup_french_horn_fingering",
        "summary": "French Horn F/Bb Double Horn Fingering Lookup",
        "description": "Look up standard F-side and Bb-trigger valve fingerings, concert pitch transposition (down a perfect fifth), and harmonic tendency notes for any written French Horn note (e.g. \"C4\", \"F4\", \"G4\", \"Bb4\", \"C5\", \"F5\").",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "note": {
                    "type": "string",
                    "description": "Written note name with octave (e.g. \"C4\", \"F4\", \"G4\", \"Bb4\", \"C5\", \"F5\")"
                  }
                },
                "required": [
                  "note"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from lookup_french_horn_fingering"
          }
        }
      }
    },
    "/api/v1/tools/transpose_french_horn_pitch": {
      "post": {
        "operationId": "transpose_french_horn_pitch",
        "summary": "Historical & Orchestral French Horn Transposition Calculator",
        "description": "Transpose written French Horn parts from historical orchestral crooks (Horn in Eb, D, C, G, A, E, Bb-alto, Bb-basso) to modern Horn in F written pitch and Concert Pitch, with interval semitone shifts and clef rules.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "writtenNote": {
                    "type": "string",
                    "description": "Written note in the original orchestral score (e.g. \"C4\", \"G4\", \"E5\")"
                  },
                  "sourceCrook": {
                    "type": "string",
                    "enum": [
                      "Eb",
                      "D",
                      "C",
                      "G",
                      "A",
                      "E",
                      "Bb-alto",
                      "Bb-basso",
                      "F"
                    ],
                    "description": "Historical horn crook marked in the score (e.g. \"Eb\" for Beethoven Eroica, \"D\" for Bach/Mozart, \"C\" for Brahms)"
                  }
                },
                "required": [
                  "writtenNote",
                  "sourceCrook"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from transpose_french_horn_pitch"
          }
        }
      }
    },
    "/api/v1/tools/analyze_horn_harmonic_series": {
      "post": {
        "operationId": "analyze_horn_harmonic_series",
        "summary": "French Horn Overtone & Harmonic Series Analyzer",
        "description": "Analyze the natural harmonic overtone series (partials 2 through 16) for any F-horn or Bb-horn valve combination, returning equal-temperament cent deviations (e.g. -14 cents on 5th partial, -31 cents on 7th partial) and alternate valve solutions.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hornSide": {
                    "type": "string",
                    "enum": [
                      "F",
                      "Bb"
                    ],
                    "description": "Horn side tube length: \"F\" (open fundamental F1) or \"Bb\" (trigger fundamental Bb1)"
                  },
                  "valves": {
                    "type": "string",
                    "description": "Valve combination (e.g. \"0\", \"2\", \"1\", \"1-2\", \"2-3\", \"1-3\", \"1-2-3\")"
                  }
                },
                "required": [
                  "hornSide"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from analyze_horn_harmonic_series"
          }
        }
      }
    },
    "/api/v1/tools/lookup_horn_trill_fingering": {
      "post": {
        "operationId": "lookup_horn_trill_fingering",
        "summary": "French Horn Valve Trill & Lip Trill Fingering Guide",
        "description": "Find optimal whole-tone and half-step trill fingerings on the F/Bb double horn, identifying whether a trill should be executed as a mechanical valve trill or a harmonic lip trill (common above written E5 on the F side).",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "baseNote": {
                    "type": "string",
                    "description": "Principal written note of the trill (e.g. \"F#4\", \"G4\", \"A4\", \"B4\", \"C5\", \"D5\")"
                  },
                  "interval": {
                    "type": "string",
                    "enum": [
                      "half-step",
                      "whole-step"
                    ],
                    "description": "Trill interval above the principal note (\"half-step\" or \"whole-step\")"
                  }
                },
                "required": [
                  "baseNote"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from lookup_horn_trill_fingering"
          }
        }
      }
    },
    "/api/v1/tools/get_orchestral_horn_excerpt_guide": {
      "post": {
        "operationId": "get_orchestral_horn_excerpt_guide",
        "summary": "Standard Orchestral Audition Excerpt Fingering & Pedagogy Guide",
        "description": "Retrieve audition preparation notes, recommended F/Bb trigger fingerings, breathing plans, and historical crook transpositions for standard orchestral French Horn excerpts (Mozart 4, Beethoven 3/7/9, Brahms 1/3, Mahler 5, Strauss Till Eulenspiegel / Ein Heldenleben, Tchaikovsky 5).",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "composerOrWork": {
                    "type": "string",
                    "description": "Composer or orchestral work name (e.g. \"Mozart 4\", \"Strauss Till\", \"Tchaikovsky 5\", \"Brahms 3\", \"Beethoven 7\", \"Mahler 5\")"
                  }
                },
                "required": [
                  "composerOrWork"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from get_orchestral_horn_excerpt_guide"
          }
        }
      }
    },
    "/api/v1/tools/diagnose_horn_intonation_and_hand_position": {
      "post": {
        "operationId": "diagnose_horn_intonation_and_hand_position",
        "summary": "French Horn Intonation, Right-Hand Bell Position & Stopped Horn Diagnostic",
        "description": "Diagnose pitch tendencies, right-hand bell acoustics, and Stopped Horn (gestopft / +) transposition rules (transpose down a half-step on the F horn side to compensate for the +1/2 step acoustic shortening when sealing the bell).",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "type": "string",
                    "enum": [
                      "stopped-horn",
                      "muted-horn",
                      "sharp-high-register",
                      "flat-5th-partial",
                      "right-hand-cup"
                    ],
                    "description": "Acoustic or intonation topic to diagnose"
                  }
                },
                "required": [
                  "topic"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from diagnose_horn_intonation_and_hand_position"
          }
        }
      }
    },
    "/api/v1/tools/recommend_beginner_horn_and_mouthpiece": {
      "post": {
        "operationId": "recommend_beginner_horn_and_mouthpiece",
        "summary": "French Horn Wrap (Kruspe vs Geyer) & Mouthpiece Selector",
        "description": "Compare Kruspe wrap (Conn 8D style, dark orchestral projection, larger bell throat) vs Geyer/Knopf wrap (Yamaha 667/671, Alexander 103 style, smooth slurs, medium throat) and recommend mouthpiece cup depths and rim diameters by player level.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "playerLevel": {
                    "type": "string",
                    "enum": [
                      "beginner",
                      "intermediate-high-school",
                      "conservatory-orchestral",
                      "high-horn-principal",
                      "low-horn-section"
                    ],
                    "description": "Player experience level or orchestral role"
                  }
                },
                "required": [
                  "playerLevel"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from recommend_beginner_horn_and_mouthpiece"
          }
        }
      }
    },
    "/api/v1/tools/generate_daily_horn_warmup_routine": {
      "post": {
        "operationId": "generate_daily_horn_warmup_routine",
        "summary": "Daily French Horn Warm-Up & Embouchure Routine Generator",
        "description": "Generate a structured daily French Horn warm-up schedule covering harmonic lip slurs, Farkas long tones, double/triple tonguing, low-register pedal tones, and dynamic control tailored to available practice time.",
        "security": [
          {
            "ApiKeyAuth": []
          },
          {
            "BearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "durationMinutes": {
                    "type": "number",
                    "description": "Available warm-up duration in minutes (e.g. 15, 30, 45, 60)"
                  },
                  "focusArea": {
                    "type": "string",
                    "enum": [
                      "balanced",
                      "high-range-endurance",
                      "low-register-response",
                      "legato-lip-slurs",
                      "articulation-agility"
                    ],
                    "description": "Primary technical focus area for the session"
                  }
                },
                "required": [
                  "durationMinutes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deterministic JSON output from generate_daily_horn_warmup_routine"
          }
        }
      }
    }
  }
}