openapi: 3.0.3
info:
  title: Dirigon API
  version: v1
  description: >
    BDC Schedule of Investments API. Fund tapes, credits, and the marks each
    holder filed. Data is taken from SEC 10-Q and 10-K filings.
  x-mcp-tools:
    - get_coverage
    - get_issuer
    - get_filer
    - get_positions
    - get_disagreement
    - get_non_accrual
    - get_sector
    - get_clo_tranche
servers:
  - url: /v1
security:
  - ApiKey: []
paths:
  /coverage:
    get:
      operationId: getCoverage
      x-mcp-tool: get_coverage
      summary: How many funds and credits are in the latest snapshot.
      responses:
        "200": { description: Coverage }
        "401": { description: Unauthorized }
        "429": { description: Rate limited }
  /issuers:
    get:
      operationId: listIssuers
      x-mcp-tool: get_issuer
      summary: Find a credit. sort=holders|fv|spread. preset=disagreement is the widest-marks screen.
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Cursor"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/CompileId"
        - name: sort
          in: query
          schema: { type: string, enum: [holders, fv, spread] }
        - name: sector
          in: query
          schema: { type: string }
        - name: preset
          in: query
          schema: { type: string, enum: [disagreement] }
      responses:
        "200": { description: Issuer page }
  /issuers/{issuer_id}:
    get:
      operationId: getIssuer
      x-mcp-tool: get_issuer
      parameters:
        - $ref: "#/components/parameters/IssuerId"
        - $ref: "#/components/parameters/CompileId"
      responses:
        "200": { description: Issuer }
        "404": { description: Not found }
  /issuers/{issuer_id}/marks:
    get:
      operationId: getIssuerMarks
      x-mcp-tool: get_disagreement
      summary: Holder marks for one credit. Every fund that printed the name.
      parameters:
        - $ref: "#/components/parameters/IssuerId"
        - $ref: "#/components/parameters/CompileId"
      responses:
        "200": { description: Marks }
        "404": { description: Not found or blocked }
  /filers:
    get:
      operationId: listFilers
      x-mcp-tool: get_filer
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Cursor"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/CompileId"
        - name: sort
          in: query
          schema: { type: string, enum: [fv, software_pct] }
      responses:
        "200": { description: Filer page }
  /filers/{cik}:
    get:
      operationId: getFiler
      x-mcp-tool: get_filer
      parameters:
        - $ref: "#/components/parameters/Cik"
        - $ref: "#/components/parameters/CompileId"
      responses:
        "200": { description: Filer }
        "404": { description: Not found }
  /filers/{cik}/positions:
    get:
      operationId: getFilerPositions
      x-mcp-tool: get_positions
      summary: The fund's Schedule of Investments, line by line.
      parameters:
        - $ref: "#/components/parameters/Cik"
        - $ref: "#/components/parameters/Cursor"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/CompileId"
      responses:
        "200": { description: Positions }
  /non-accrual:
    get:
      operationId: getNonAccrual
      x-mcp-tool: get_non_accrual
      summary: Lines the fund footnoted as non-accrual.
      parameters:
        - $ref: "#/components/parameters/Cursor"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/CompileId"
      responses:
        "200": { description: Non-accrual }
  /sectors:
    get:
      operationId: getSectors
      x-mcp-tool: get_sector
      summary: Normalized sector book. q=software|healthcare. view=credits|funds. cik= one fund.
      parameters:
        - $ref: "#/components/parameters/Q"
        - name: view
          in: query
          schema: { type: string, enum: [summary, credits, funds] }
        - $ref: "#/components/parameters/Cik"
        - $ref: "#/components/parameters/Limit"
      responses:
        "200": { description: Sector book }
  /software:
    get:
      operationId: getSoftware
      x-mcp-tool: get_software
      summary: Software book. Same as /sectors?q=software.
      parameters:
        - name: view
          in: query
          schema: { type: string, enum: [summary, credits, funds] }
        - $ref: "#/components/parameters/Cik"
        - $ref: "#/components/parameters/Limit"
      responses:
        "200": { description: Software book }
  /clo-tranches:
    get:
      operationId: listCloTranches
      x-mcp-tool: get_clo_tranche
      summary: CLO note holder graph. Default is cross-vehicle connections. view=books is field fill vs the canonical standard.
      parameters:
        - $ref: "#/components/parameters/Q"
        - $ref: "#/components/parameters/Cursor"
        - $ref: "#/components/parameters/Limit"
        - $ref: "#/components/parameters/CompileId"
        - name: view
          in: query
          schema: { type: string, enum: [connections, overlap, books, all] }
        - name: vehicle
          in: query
          schema: { type: string, enum: [bdc, interval, clo, loan_cef] }
      responses:
        "200": { description: CLO tranche page }
  /clo-tranches/{tranche_key}:
    get:
      operationId: getCloTranche
      x-mcp-tool: get_clo_tranche
      summary: Holders and marks for one CLO note (deal|class).
      parameters:
        - name: tranche_key
          in: path
          required: true
          schema: { type: string }
        - $ref: "#/components/parameters/CompileId"
      responses:
        "200": { description: CLO tranche }
        "404": { description: Not found }
  /compiles/latest/manifest.json:
    get:
      operationId: getManifest
      summary: Snapshot manifest (row counts and checksums).
      responses:
        "200": { description: Manifest }
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: X-API-KEY
  parameters:
    IssuerId:
      name: issuer_id
      in: path
      required: true
      schema: { type: string }
    Cik:
      name: cik
      in: path
      required: true
      schema: { type: integer }
    Q:
      name: q
      in: query
      schema: { type: string }
    Cursor:
      name: cursor
      in: query
      schema: { type: string }
    Limit:
      name: limit
      in: query
      schema: { type: integer, default: 100, maximum: 500 }
    CompileId:
      name: compile_id
      in: query
      description: Pin a snapshot. Default is latest.
      schema: { type: string }
