{
  "openapi": "3.1.0",
  "info": {
    "title": "Finance CLI command adapter contract",
    "version": "0.1.0b0",
    "description": "OpenAPI-style schema for adapters that expose Finance CLI commands over HTTP, MCP, or tool runtimes. The CLI itself is local."
  },
  "servers": [
    {
      "url": "local://finance-cli",
      "description": "Adapter-defined local execution endpoint."
    }
  ],
  "paths": {
    "/commands/backtest.describe": {
      "post": {
        "operationId": "finance_backtest_describe",
        "summary": "Describe a backtest strategy and its parameters",
        "description": "Use for repeatable strategy checks, payload construction, and VectorBT result summaries.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "description": "Built-in strategy key."
                  }
                },
                "required": [
                  "strategy"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.describe",
          "usage": "finance backtest.describe STRATEGY",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/backtest.factor.payload": {
      "post": {
        "operationId": "finance_backtest_factor_payload",
        "summary": "Build a normalized factor backtest payload",
        "description": "Use for repeatable strategy checks, payload construction, and VectorBT result summaries.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "factor_name": {
                    "type": "string",
                    "description": "Name assigned to the factor signal."
                  },
                  "symbols": {
                    "type": "string",
                    "description": "Ticker symbol or comma-separated ticker list."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date."
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date."
                  },
                  "timeframe": {
                    "type": "string",
                    "description": "Provider-supported timeframe or research horizon.",
                    "default": "1d"
                  },
                  "top_pct": {
                    "type": "number",
                    "description": "Top-ranked percentage used for the long or overweight side.",
                    "default": 0.2
                  },
                  "bottom_pct": {
                    "type": "number",
                    "description": "Bottom-ranked percentage used for the short or underweight side.",
                    "default": 0.2
                  }
                },
                "required": [
                  "factor_name",
                  "symbols",
                  "start_date",
                  "end_date"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.factor.payload",
          "usage": "finance backtest.factor.payload FACTOR_NAME SYMBOLS START_DATE END_DATE [timeframe=1d top_pct=0.2 bottom_pct=0.2]",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/backtest.factor.weights": {
      "post": {
        "operationId": "finance_backtest_factor_weights",
        "summary": "Preview quantile factor target weights",
        "description": "Use for repeatable strategy checks, payload construction, and VectorBT result summaries.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "factor_name": {
                    "type": "string",
                    "description": "Name assigned to the factor signal."
                  },
                  "scores": {
                    "type": "string",
                    "description": "Mapping of symbols to factor scores."
                  },
                  "top_pct": {
                    "type": "number",
                    "description": "Top-ranked percentage used for the long or overweight side.",
                    "default": 0.2
                  },
                  "bottom_pct": {
                    "type": "number",
                    "description": "Bottom-ranked percentage used for the short or underweight side.",
                    "default": 0.2
                  }
                },
                "required": [
                  "factor_name",
                  "scores"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.factor.weights",
          "usage": "finance backtest.factor.weights FACTOR_NAME scores='{\"AAPL\":1.2,\"MSFT\":0.4}' [top_pct=0.2 bottom_pct=0.2]",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/backtest.run": {
      "post": {
        "operationId": "finance_backtest_run",
        "summary": "Run a VectorBT strategy backtest",
        "description": "Use when the user asks to run a named strategy over explicit symbols and dates.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "description": "Built-in strategy key."
                  },
                  "symbols": {
                    "type": "string",
                    "description": "Ticker symbol or comma-separated ticker list."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date."
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date."
                  },
                  "params": {
                    "type": "object",
                    "description": "Strategy parameters supplied as JSON or key-value pairs.",
                    "default": "{}"
                  },
                  "strategy_file": {
                    "type": "string",
                    "description": "Path to a custom strategy file.",
                    "default": "./rule.py"
                  }
                },
                "required": [
                  "strategy",
                  "symbols",
                  "start_date",
                  "end_date"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.run",
          "usage": "finance backtest.run STRATEGY SYMBOLS START_DATE END_DATE [params='{}' strategy_file=./rule.py]",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/backtest.strategies": {
      "post": {
        "operationId": "finance_backtest_strategies",
        "summary": "List VectorBT-backed strategy presets",
        "description": "Use for repeatable strategy checks, payload construction, and VectorBT result summaries.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.strategies",
          "usage": "finance backtest.strategies",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/backtest.strategy.payload": {
      "post": {
        "operationId": "finance_backtest_strategy_payload",
        "summary": "Build a normalized strategy backtest payload",
        "description": "Use for repeatable strategy checks, payload construction, and VectorBT result summaries.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy_id": {
                    "type": "string",
                    "description": "Built-in strategy key to describe, run, or package."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date."
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date."
                  },
                  "initial_cash": {
                    "type": "integer",
                    "description": "Starting cash balance for the simulation.",
                    "default": 100000
                  },
                  "parameters": {
                    "type": "object",
                    "description": "Strategy parameter object included in the payload.",
                    "default": "{}"
                  }
                },
                "required": [
                  "strategy_id",
                  "start_date",
                  "end_date"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.strategy.payload",
          "usage": "finance backtest.strategy.payload STRATEGY_ID START_DATE END_DATE [initial_cash=100000 parameters='{}']",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/backtest.tune": {
      "post": {
        "operationId": "finance_backtest_tune",
        "summary": "Run a bounded VectorBT parameter grid",
        "description": "Use for repeatable strategy checks, payload construction, and VectorBT result summaries.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "description": "Built-in strategy key."
                  },
                  "symbols": {
                    "type": "string",
                    "description": "Ticker symbol or comma-separated ticker list."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date."
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date."
                  },
                  "grid": {
                    "type": "object",
                    "description": "Parameter grid where each key maps to candidate values."
                  },
                  "metric": {
                    "type": "string",
                    "description": "Metric used to rank tuning results.",
                    "default": "sharpe_ratio"
                  },
                  "max_runs": {
                    "type": "integer",
                    "description": "Maximum parameter combinations to evaluate.",
                    "default": 100
                  }
                },
                "required": [
                  "strategy",
                  "symbols",
                  "start_date",
                  "end_date",
                  "grid"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Backtest metrics, trades, plots, or payload metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "backtest.tune",
          "usage": "finance backtest.tune STRATEGY SYMBOLS START_DATE END_DATE grid='{}' [metric=sharpe_ratio max_runs=100]",
          "side_effects": "network_read_only",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/calendar.company": {
      "post": {
        "operationId": "finance_calendar_company",
        "summary": "Fetch company earnings/dividend calendar fields",
        "description": "Use for company calendar fields and earnings-date rows.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Company calendar or earnings-date rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "calendar.company",
          "usage": "finance calendar.company SYMBOL",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/calendar.earnings": {
      "post": {
        "operationId": "finance_calendar_earnings",
        "summary": "Fetch earnings-date rows for a company",
        "description": "Use for company calendar fields and earnings-date rows.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 12
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Company calendar or earnings-date rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "calendar.earnings",
          "usage": "finance calendar.earnings SYMBOL [limit=12]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/document.ocr": {
      "post": {
        "operationId": "finance_document_ocr",
        "summary": "Run PaddleOCR/PP-StructureV3 OCR fallback on a local or remote document",
        "description": "Use as fallback for scanned or image-heavy PDFs after document.read/scan cannot extract text.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command."
                  },
                  "max_chars": {
                    "type": "integer",
                    "description": "Maximum text characters to return.",
                    "default": 12000
                  },
                  "max_pages": {
                    "type": "integer",
                    "description": "Maximum PDF pages to read.",
                    "default": 5
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Document text, blocks, matches, tables, OCR, or window metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "document.ocr",
          "usage": "finance document.ocr SOURCE|source=PATH_OR_URL [max_chars=12000 max_pages=5]",
          "side_effects": "local_or_network_read",
          "auth_required": "none",
          "citation_fields": [
            "source",
            "url",
            "path",
            "page",
            "start_char",
            "end_char",
            "match_id"
          ]
        }
      }
    },
    "/commands/document.read": {
      "post": {
        "operationId": "finance_document_read",
        "summary": "Extract native PDF or HTML text and layout/search blocks",
        "description": "Use for first-pass text extraction from a known PDF or SEC HTML URL.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "html"
                    ],
                    "description": "Value supplied for `format`."
                  },
                  "max_chars": {
                    "type": "integer",
                    "description": "Maximum text characters to return.",
                    "default": 12000
                  },
                  "max_pages": {
                    "type": "integer",
                    "description": "Maximum PDF pages to read.",
                    "default": 5
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Document text, blocks, matches, tables, OCR, or window metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "document.read",
          "usage": "finance document.read SOURCE|source=PATH_OR_URL [format=pdf|html max_chars=12000 max_pages=5]",
          "side_effects": "local_or_network_read",
          "auth_required": "none",
          "citation_fields": [
            "source",
            "url",
            "path",
            "page",
            "start_char",
            "end_char",
            "match_id"
          ]
        }
      }
    },
    "/commands/document.scan": {
      "post": {
        "operationId": "finance_document_scan",
        "summary": "Scan document text/layout for configured topics or literal queries with RapidFuzz",
        "description": "Use when the user needs phrase, table, or topic discovery inside a filing or document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Local path or URL."
                  },
                  "query": {
                    "type": "string",
                    "description": "Literal phrase or table text to find."
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Known topic names or literal queries."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "html"
                    ],
                    "description": "Document format override."
                  },
                  "match": {
                    "type": "string",
                    "default": "fuzzy",
                    "enum": [
                      "fuzzy",
                      "all_terms"
                    ],
                    "description": "Match mode."
                  },
                  "threshold": {
                    "type": "number",
                    "default": 80.0,
                    "description": "Fuzzy score threshold."
                  },
                  "max_chars": {
                    "type": "integer",
                    "default": 12000,
                    "description": "Maximum text chars to read; 0 means unbounded in current readers."
                  },
                  "max_pages": {
                    "type": "integer",
                    "default": 5,
                    "description": "Maximum pages for PDFs; 0 means all pages."
                  },
                  "limit": {
                    "type": "integer",
                    "default": 50,
                    "description": "Maximum matches."
                  },
                  "window": {
                    "type": "integer",
                    "default": 0,
                    "description": "Optional context chars per match."
                  },
                  "start_char": {
                    "type": "integer",
                    "description": "Start offset for a bounded scan."
                  },
                  "end_char": {
                    "type": "integer",
                    "description": "End offset for a bounded scan."
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "source": {
                              "type": "string"
                            },
                            "matches": {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            },
                            "count": {
                              "type": "integer"
                            },
                            "char_count": {
                              "type": "integer"
                            },
                            "warnings": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "document.scan",
          "usage": "finance document.scan SOURCE|source=PATH_OR_URL [query=TEXT topics=risk,disclosure format=pdf|html match=fuzzy|all_terms threshold=80 max_chars=12000 max_pages=5 limit=50 window=0 start_char=0 end_char=0]",
          "side_effects": "local_or_network_read",
          "auth_required": "none",
          "citation_fields": [
            "source",
            "url",
            "path",
            "page",
            "start_char",
            "end_char",
            "match_id"
          ]
        }
      }
    },
    "/commands/document.tables": {
      "post": {
        "operationId": "finance_document_tables",
        "summary": "Extract compact table previews from text-based PDFs with Camelot",
        "description": "Use for table previews in text-based PDFs when text windows are not enough.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command."
                  },
                  "pages": {
                    "type": "string",
                    "description": "PDF page selection passed to the table extractor.",
                    "default": "1-end"
                  },
                  "flavor": {
                    "type": "string",
                    "description": "PDF table extraction flavor.",
                    "enum": [
                      "stream",
                      "lattice"
                    ]
                  },
                  "max_tables": {
                    "type": "integer",
                    "description": "Maximum extracted tables to return.",
                    "default": 20
                  },
                  "max_rows": {
                    "type": "integer",
                    "description": "Maximum rows to return.",
                    "default": 25
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Document text, blocks, matches, tables, OCR, or window metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "document.tables",
          "usage": "finance document.tables SOURCE|source=PATH_OR_URL [pages=1-end flavor=stream|lattice max_tables=20 max_rows=25]",
          "side_effects": "local_or_network_read",
          "auth_required": "none",
          "citation_fields": [
            "source",
            "url",
            "path",
            "page",
            "start_char",
            "end_char",
            "match_id"
          ]
        }
      }
    },
    "/commands/document.window": {
      "post": {
        "operationId": "finance_document_window",
        "summary": "Read a bounded text window around a document offset or scan match ID",
        "description": "Use after document.scan to read around a stable char offset or match_id without re-scanning the full document.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Local path or URL."
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "html"
                    ],
                    "description": "Document format override."
                  },
                  "start_char": {
                    "type": "integer",
                    "description": "Character offset."
                  },
                  "match_id": {
                    "type": "string",
                    "description": "Match id returned by document.scan."
                  },
                  "chars": {
                    "type": "integer",
                    "default": 4000,
                    "description": "Window size in characters."
                  },
                  "direction": {
                    "type": "string",
                    "default": "around",
                    "enum": [
                      "around",
                      "next",
                      "previous"
                    ],
                    "description": "Window direction."
                  }
                },
                "required": [
                  "source"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Document text, blocks, matches, tables, OCR, or window metadata.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "document.window",
          "usage": "finance document.window SOURCE|source=PATH_OR_URL [format=pdf|html start_char=0|match_id=char_START_END chars=4000 direction=around|next|previous]",
          "side_effects": "local_or_network_read",
          "auth_required": "none",
          "citation_fields": [
            "source",
            "url",
            "path",
            "page",
            "start_char",
            "end_char",
            "match_id"
          ]
        }
      }
    },
    "/commands/estimates.compare": {
      "post": {
        "operationId": "finance_estimates_compare",
        "summary": "Compare user assumptions against explicit consensus inputs",
        "description": "Use for explicit estimate comparison math and structured consensus result shaping.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "revenue": {
                    "type": "string",
                    "description": "Reported, assumed, or user-supplied revenue input."
                  },
                  "consensus_revenue": {
                    "type": "string",
                    "description": "Consensus revenue estimate used for comparison."
                  },
                  "eps": {
                    "type": "number",
                    "description": "Reported or assumed EPS value used for comparison."
                  },
                  "consensus_eps": {
                    "type": "number",
                    "description": "Consensus EPS estimate used for comparison."
                  },
                  "fiscal_year": {
                    "type": "integer",
                    "description": "Fiscal year for the reported or estimated period."
                  }
                },
                "required": [
                  "revenue",
                  "consensus_revenue",
                  "eps",
                  "consensus_eps",
                  "fiscal_year"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Consensus estimate or comparison result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "estimates.compare",
          "usage": "finance estimates.compare [SYMBOL] revenue=2.2B consensus_revenue=2.0B eps=0.50 consensus_eps=0.45 fiscal_year=2027",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/estimates.consensus": {
      "post": {
        "operationId": "finance_estimates_consensus",
        "summary": "Fetch FMP analyst consensus estimates when configured",
        "description": "Use for explicit estimate comparison math and structured consensus result shaping.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "period": {
                    "type": "string",
                    "description": "Financial statement period, such as annual or quarterly.",
                    "enum": [
                      "annual",
                      "quarter"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 10
                  },
                  "page": {
                    "type": "integer",
                    "description": "Page number to request from the provider.",
                    "default": 0
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Consensus estimate or comparison result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "estimates.consensus",
          "usage": "finance estimates.consensus SYMBOL [period=annual|quarter limit=10 page=0]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/filings.read": {
      "post": {
        "operationId": "finance_filings_read",
        "summary": "Read a canonical 10-K section with edgartools",
        "description": "Use when the user asks for a canonical 10-K section such as business, risk factors, MD&A, or segments.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "accession": {
                    "type": "string",
                    "description": "SEC accession number."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "form": {
                    "type": "string",
                    "description": "SEC form type.",
                    "default": "10-K"
                  },
                  "section": {
                    "type": "string",
                    "description": "Filing section key.",
                    "enum": [
                      "business",
                      "risk_factors",
                      "mda",
                      "segments"
                    ]
                  },
                  "max_chars": {
                    "type": "integer",
                    "description": "Maximum text characters to return.",
                    "default": 8000
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "SEC filing metadata, section text, reports, or XBRL rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "filings.read",
          "usage": "finance filings.read [SYMBOL] [accession=ACCESSION|url=URL] [form=10-K section=business|risk_factors|mda|segments max_chars=8000]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "accession_no",
            "accession",
            "url",
            "form",
            "report_name",
            "section"
          ]
        }
      }
    },
    "/commands/filings.recent": {
      "post": {
        "operationId": "finance_filings_recent",
        "summary": "Fetch recent SEC filings, optionally classified",
        "description": "Use first when the user names a ticker but not a filing URL or accession.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "forms": {
                    "type": "string",
                    "description": "Comma-separated SEC form types to include.",
                    "default": "8-K,10-Q"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 20
                  },
                  "classify": {
                    "type": "boolean",
                    "description": "Classify filing events when supported.",
                    "default": false
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "SEC filing metadata, section text, reports, or XBRL rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "filings.recent",
          "usage": "finance filings.recent SYMBOL [forms=8-K,10-Q limit=20 classify=false]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "accession_no",
            "accession",
            "url",
            "form",
            "report_name",
            "section"
          ]
        }
      }
    },
    "/commands/filings.report": {
      "post": {
        "operationId": "finance_filings_report",
        "summary": "Read an edgartools filing summary report",
        "description": "Use when the user already knows or discovered an edgartools report name and wants rows from that report.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "accession": {
                    "type": "string",
                    "description": "SEC accession number."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "name": {
                    "type": "string",
                    "description": "Report, section, or table name selected by the caller."
                  },
                  "form": {
                    "type": "string",
                    "description": "SEC form type.",
                    "default": "10-K"
                  },
                  "query": {
                    "type": "string",
                    "description": "Search query."
                  },
                  "max_rows": {
                    "type": "integer",
                    "description": "Maximum rows to return.",
                    "default": 25
                  },
                  "max_chars": {
                    "type": "integer",
                    "description": "Maximum text characters to return.",
                    "default": 8000
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "SEC filing metadata, section text, reports, or XBRL rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "filings.report",
          "usage": "finance filings.report [SYMBOL] [accession=ACCESSION|url=URL] name='Report Short Name' [form=10-K query=TEXT max_rows=25 (0=unlimited) max_chars=8000]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "accession_no",
            "accession",
            "url",
            "form",
            "report_name",
            "section"
          ]
        }
      }
    },
    "/commands/filings.reports": {
      "post": {
        "operationId": "finance_filings_reports",
        "summary": "List edgartools filing summary reports",
        "description": "Use for SEC filing discovery, canonical section reads, XBRL statement rows, and filing summary reports.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "accession": {
                    "type": "string",
                    "description": "SEC accession number."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "form": {
                    "type": "string",
                    "description": "SEC form type.",
                    "default": "10-K"
                  },
                  "query": {
                    "type": "string",
                    "description": "Search query.",
                    "default": "lease"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "SEC filing metadata, section text, reports, or XBRL rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "filings.reports",
          "usage": "finance filings.reports [SYMBOL] [accession=ACCESSION|url=URL] [form=10-K query=lease]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "accession_no",
            "accession",
            "url",
            "form",
            "report_name",
            "section"
          ]
        }
      }
    },
    "/commands/filings.sections": {
      "post": {
        "operationId": "finance_filings_sections",
        "summary": "List supported and discovered filing sections",
        "description": "Use for SEC filing discovery, canonical section reads, XBRL statement rows, and filing summary reports.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "accession": {
                    "type": "string",
                    "description": "SEC accession number."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "form": {
                    "type": "string",
                    "description": "SEC form type.",
                    "default": "10-K"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "SEC filing metadata, section text, reports, or XBRL rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "filings.sections",
          "usage": "finance filings.sections [SYMBOL] [accession=ACCESSION|url=URL] [form=10-K]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "accession_no",
            "accession",
            "url",
            "form",
            "report_name",
            "section"
          ]
        }
      }
    },
    "/commands/filings.statement": {
      "post": {
        "operationId": "finance_filings_statement",
        "summary": "Read structured XBRL statement rows with edgartools",
        "description": "Use when the user asks for structured XBRL financial statement rows such as income, balance, or cashflow items.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker used to locate a recent filing."
                  },
                  "accession": {
                    "type": "string",
                    "description": "SEC accession number."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Direct SEC filing URL."
                  },
                  "form": {
                    "type": "string",
                    "default": "10-K",
                    "description": "SEC form used when resolving by symbol."
                  },
                  "statement": {
                    "type": "string",
                    "default": "income",
                    "enum": [
                      "income",
                      "balance",
                      "cashflow"
                    ],
                    "description": "Statement family."
                  },
                  "query": {
                    "type": "string",
                    "description": "Optional row label search."
                  },
                  "max_rows": {
                    "type": "integer",
                    "default": 0,
                    "description": "Maximum rows; 0 means unlimited."
                  },
                  "include_abstract": {
                    "type": "boolean",
                    "default": false,
                    "description": "Include abstract rows when true."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "symbol": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "accession_no": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "url": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "statement": {
                              "type": "string"
                            },
                            "rows": {
                              "type": "array",
                              "items": {
                                "type": "object"
                              }
                            },
                            "count": {
                              "type": "integer"
                            },
                            "source": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "filings.statement",
          "usage": "finance filings.statement [SYMBOL] [accession=ACCESSION|url=URL] [form=10-K statement=income|balance|cashflow query=TEXT max_rows=0]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "accession_no",
            "accession",
            "url",
            "form",
            "report_name",
            "section"
          ]
        }
      }
    },
    "/commands/formula.adjusted_ebitda": {
      "post": {
        "operationId": "finance_formula_adjusted_ebitda",
        "summary": "Calculate adjusted EBITDA from explicit addbacks",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ebit": {
                    "type": "number",
                    "description": "Value supplied for `ebit`."
                  },
                  "d_and_a": {
                    "type": "number",
                    "description": "Value supplied for `d_and_a`."
                  },
                  "addbacks": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "default": [],
                    "description": "Comma-separated addback values."
                  }
                },
                "required": [
                  "ebit",
                  "d_and_a"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.adjusted_ebitda",
          "usage": "finance formula.adjusted_ebitda ebit=9285 d_and_a=2237 addbacks=284,163",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.cagr": {
      "post": {
        "operationId": "finance_formula_cagr",
        "summary": "Calculate compound annual growth rate",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "number",
                    "description": "Value supplied for `start`."
                  },
                  "end": {
                    "type": "number",
                    "description": "Value supplied for `end`."
                  },
                  "periods": {
                    "type": "number",
                    "description": "Value supplied for `periods`."
                  }
                },
                "required": [
                  "start",
                  "end",
                  "periods"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.cagr",
          "usage": "finance formula.cagr start=100 end=150 periods=3",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.capm": {
      "post": {
        "operationId": "finance_formula_capm",
        "summary": "Calculate CAPM cost of equity",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "risk_free": {
                    "type": "number",
                    "description": "Value supplied for `risk_free`."
                  },
                  "beta": {
                    "type": "number",
                    "description": "Value supplied for `beta`."
                  },
                  "market_return": {
                    "type": "number",
                    "description": "Value supplied for `market_return`."
                  }
                },
                "required": [
                  "risk_free",
                  "beta",
                  "market_return"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.capm",
          "usage": "finance formula.capm risk_free=4.617% beta=0.79 market_return=11%",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.days": {
      "post": {
        "operationId": "finance_formula_days",
        "summary": "Calculate average-balance days",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current": {
                    "type": "number",
                    "description": "Value supplied for `current`."
                  },
                  "prior": {
                    "type": "number",
                    "description": "Value supplied for `prior`."
                  },
                  "denominator": {
                    "type": "number",
                    "description": "Value supplied for `denominator`."
                  },
                  "days": {
                    "type": "number",
                    "default": 365,
                    "description": "Value supplied for `days`."
                  }
                },
                "required": [
                  "current",
                  "prior",
                  "denominator"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.days",
          "usage": "finance formula.days current=2721 prior=2285 denominator=254453 [days=365]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.ebitda": {
      "post": {
        "operationId": "finance_formula_ebitda",
        "summary": "Calculate EBITDA from explicit EBIT and D&A inputs",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ebit": {
                    "type": "number",
                    "description": "Value supplied for `ebit`."
                  },
                  "d_and_a": {
                    "type": "number",
                    "description": "Value supplied for `d_and_a`."
                  }
                },
                "required": [
                  "ebit",
                  "d_and_a"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.ebitda",
          "usage": "finance formula.ebitda ebit=9285 d_and_a=2237",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.enterprise_value": {
      "post": {
        "operationId": "finance_formula_enterprise_value",
        "summary": "Calculate enterprise value with explicit operating cash",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market_equity": {
                    "type": "number",
                    "description": "Value supplied for `market_equity`."
                  },
                  "debt": {
                    "type": "number",
                    "default": 0,
                    "description": "Debt value."
                  },
                  "cash": {
                    "type": "number",
                    "default": 0,
                    "description": "Cash value."
                  },
                  "operating_cash": {
                    "type": "number",
                    "default": 0,
                    "description": "Cash treated as operating rather than excess."
                  }
                },
                "required": [
                  "market_equity"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.enterprise_value",
          "usage": "finance formula.enterprise_value market_equity=418856 debt=11415 cash=11144 operating_cash=5089",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.lease_equivalent": {
      "post": {
        "operationId": "finance_formula_lease_equivalent",
        "summary": "Estimate lease equivalent from cost ratio",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "base_liability": {
                    "type": "number",
                    "description": "Value supplied for `base_liability`."
                  },
                  "variable_cost": {
                    "type": "number",
                    "description": "Value supplied for `variable_cost`."
                  },
                  "operating_cost": {
                    "type": "number",
                    "description": "Value supplied for `operating_cost`."
                  }
                },
                "required": [
                  "base_liability",
                  "variable_cost",
                  "operating_cost"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.lease_equivalent",
          "usage": "finance formula.lease_equivalent base_liability=2554 variable_cost=163 operating_cost=284",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.margin": {
      "post": {
        "operationId": "finance_formula_margin",
        "summary": "Calculate numerator / denominator",
        "description": "Use for explicit numerator/denominator ratio math after cited inputs are known.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numerator": {
                    "type": "number",
                    "description": "Value supplied for `numerator`."
                  },
                  "denominator": {
                    "type": "number",
                    "description": "Value supplied for `denominator`."
                  }
                },
                "required": [
                  "numerator",
                  "denominator"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.margin",
          "usage": "finance formula.margin numerator=11969 denominator=254453",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.net_debt": {
      "post": {
        "operationId": "finance_formula_net_debt",
        "summary": "Calculate net debt with explicit operating cash",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "debt": {
                    "type": "number",
                    "description": "Value supplied for `debt`."
                  },
                  "cash": {
                    "type": "number",
                    "description": "Value supplied for `cash`."
                  },
                  "operating_cash": {
                    "type": "number",
                    "default": 5089,
                    "description": "Value supplied for `operating_cash`."
                  }
                },
                "required": [
                  "debt",
                  "cash"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.net_debt",
          "usage": "finance formula.net_debt debt=11415 cash=11144 [operating_cash=5089]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.operating_cash": {
      "post": {
        "operationId": "finance_formula_operating_cash",
        "summary": "Calculate operating cash as min(percent of revenue, cash-like assets)",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revenue": {
                    "type": "number",
                    "description": "Reported, assumed, or user-supplied revenue input."
                  },
                  "cash_like_assets": {
                    "type": "number",
                    "description": "Value supplied for `cash_like_assets`."
                  },
                  "percent_revenue": {
                    "type": "number",
                    "default": "2%",
                    "description": "Value supplied for `percent_revenue`."
                  }
                },
                "required": [
                  "revenue",
                  "cash_like_assets"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.operating_cash",
          "usage": "finance formula.operating_cash revenue=254453 cash_like_assets=11144 [percent_revenue=2%]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.operating_current_assets": {
      "post": {
        "operationId": "finance_formula_operating_current_assets",
        "summary": "Calculate operating current assets",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current_assets": {
                    "type": "number",
                    "description": "Value supplied for `current_assets`."
                  },
                  "cash_like_assets": {
                    "type": "number",
                    "default": 11144,
                    "description": "Value supplied for `cash_like_assets`."
                  },
                  "operating_cash": {
                    "type": "number",
                    "default": 5089,
                    "description": "Value supplied for `operating_cash`."
                  }
                },
                "required": [
                  "current_assets"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.operating_current_assets",
          "usage": "finance formula.operating_current_assets current_assets=34246 [cash_like_assets=11144 operating_cash=5089]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.operating_current_liabilities": {
      "post": {
        "operationId": "finance_formula_operating_current_liabilities",
        "summary": "Calculate operating current liabilities",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current_liabilities": {
                    "type": "number",
                    "description": "Value supplied for `current_liabilities`."
                  },
                  "interest_bearing_current_debt": {
                    "type": "number",
                    "default": 103,
                    "description": "Value supplied for `interest_bearing_current_debt`."
                  }
                },
                "required": [
                  "current_liabilities"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.operating_current_liabilities",
          "usage": "finance formula.operating_current_liabilities current_liabilities=35464 [interest_bearing_current_debt=103]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.roic": {
      "post": {
        "operationId": "finance_formula_roic",
        "summary": "Calculate ROIC from NOPAT and invested capital",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "nopat": {
                    "type": "number",
                    "description": "Value supplied for `nopat`."
                  },
                  "invested_capital": {
                    "type": "number",
                    "description": "Value supplied for `invested_capital`."
                  }
                },
                "required": [
                  "nopat",
                  "invested_capital"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.roic",
          "usage": "finance formula.roic nopat=7113 invested_capital=28077",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.turnover": {
      "post": {
        "operationId": "finance_formula_turnover",
        "summary": "Calculate turnover using average balance",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "numerator": {
                    "type": "number",
                    "description": "Value supplied for `numerator`."
                  },
                  "current": {
                    "type": "number",
                    "description": "Value supplied for `current`."
                  },
                  "prior": {
                    "type": "number",
                    "description": "Value supplied for `prior`."
                  }
                },
                "required": [
                  "numerator",
                  "current",
                  "prior"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.turnover",
          "usage": "finance formula.turnover numerator=222358 current=18647 prior=16651",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.wacc": {
      "post": {
        "operationId": "finance_formula_wacc",
        "summary": "Calculate WACC with explicit debt tax convention",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "equity_value": {
                    "type": "number",
                    "description": "Equity market value used in WACC or valuation math."
                  },
                  "debt_value": {
                    "type": "number",
                    "description": "Debt value used in WACC or valuation math."
                  },
                  "cost_of_equity": {
                    "type": "number",
                    "description": "Cost of equity. CLI accepts decimal or percent."
                  },
                  "cost_of_debt": {
                    "type": "number",
                    "description": "Cost of debt. CLI accepts decimal or percent."
                  },
                  "tax_rate": {
                    "type": "number",
                    "default": 0,
                    "description": "Tax rate; CLI accepts decimal or percent."
                  },
                  "debt_tax": {
                    "type": "string",
                    "default": "after_tax",
                    "enum": [
                      "pretax",
                      "after_tax"
                    ],
                    "description": "Whether cost_of_debt is pretax or already after tax."
                  }
                },
                "required": [
                  "equity_value",
                  "debt_value",
                  "cost_of_equity",
                  "cost_of_debt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.wacc",
          "usage": "finance formula.wacc equity_value=418856 debt_value=11415 cost_of_equity=9.66% cost_of_debt=6% tax_rate=24% debt_tax=pretax|after_tax",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/formula.working_capital": {
      "post": {
        "operationId": "finance_formula_working_capital",
        "summary": "Calculate operating working capital",
        "description": "Use only when all numeric inputs are explicit in the prompt or already extracted with citations.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "operating_current_assets": {
                    "type": "number",
                    "description": "Value supplied for `operating_current_assets`."
                  },
                  "operating_current_liabilities": {
                    "type": "number",
                    "description": "Value supplied for `operating_current_liabilities`."
                  }
                },
                "required": [
                  "operating_current_assets",
                  "operating_current_liabilities"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Deterministic calculation with inputs and method.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "formula.working_capital",
          "usage": "finance formula.working_capital operating_current_assets=28191 operating_current_liabilities=35035",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/fundamentals.statement": {
      "post": {
        "operationId": "finance_fundamentals_statement",
        "summary": "Fetch income/balance/cashflow statement data",
        "description": "Use for Yahoo financial statement tables outside SEC filing context.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "statement": {
                    "type": "string",
                    "enum": [
                      "income",
                      "balance",
                      "cashflow"
                    ],
                    "description": "Financial statement family."
                  },
                  "period": {
                    "type": "string",
                    "description": "Financial statement period, such as annual or quarterly.",
                    "enum": [
                      "annual",
                      "quarterly"
                    ]
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Statement rows from Yahoo Finance.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "fundamentals.statement",
          "usage": "finance fundamentals.statement SYMBOL [statement=income|balance|cashflow period=annual|quarterly]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/industry.keys": {
      "post": {
        "operationId": "finance_industry_keys",
        "summary": "List Yahoo industry keys, optionally filtered by sector",
        "description": "Use for Yahoo industry keys, overview data, top companies, and research-report tables.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sector": {
                    "type": "string",
                    "description": "Sector key or sector name to query."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo industry key, overview, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "industry.keys",
          "usage": "finance industry.keys [sector=SECTOR_KEY]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/industry.overview": {
      "post": {
        "operationId": "finance_industry_overview",
        "summary": "Fetch industry overview metadata",
        "description": "Use for Yahoo industry keys, overview data, top companies, and research-report tables.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Provider key returned by the corresponding list command."
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo industry key, overview, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "industry.overview",
          "usage": "finance industry.overview KEY",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/industry.table": {
      "post": {
        "operationId": "finance_industry_table",
        "summary": "Fetch industry top companies or reports",
        "description": "Use for Yahoo industry keys, overview data, top companies, and research-report tables.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Provider key returned by the corresponding list command."
                  },
                  "table": {
                    "type": "string",
                    "description": "Provider table name to return.",
                    "enum": [
                      "top_companies",
                      "top_growth_companies",
                      "top_performing_companies",
                      "research_reports"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 25
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo industry key, overview, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "industry.table",
          "usage": "finance industry.table KEY [table=top_companies|top_growth_companies|top_performing_companies|research_reports limit=25]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/ir.presentations": {
      "post": {
        "operationId": "finance_ir_presentations",
        "summary": "Discover IR and investor day presentations from SEC 8-K Exhibit 99 filings",
        "description": "Use to discover or read investor presentations from SEC exhibits and company IR pages.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 20
                  },
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command.",
                    "enum": [
                      "auto",
                      "sec",
                      "company_ir",
                      "all"
                    ]
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Investor-presentation discovery or text extraction result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "ir.presentations",
          "usage": "finance ir.presentations SYMBOL [limit=20 source=auto|sec|company_ir|all]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "filing_url",
            "accession_no",
            "source"
          ]
        }
      }
    },
    "/commands/ir.read": {
      "post": {
        "operationId": "finance_ir_read",
        "summary": "Extract text from an IR presentation exhibit URL",
        "description": "Use to discover or read investor presentations from SEC exhibits and company IR pages.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "max_chars": {
                    "type": "integer",
                    "description": "Maximum text characters to return.",
                    "default": 12000
                  },
                  "ocr": {
                    "type": "string",
                    "description": "OCR mode for presentation or document text extraction.",
                    "enum": [
                      "off",
                      "auto",
                      "force"
                    ]
                  }
                },
                "required": [
                  "url"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Investor-presentation discovery or text extraction result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "ir.read",
          "usage": "finance ir.read url=URL [max_chars=12000 ocr=off|auto|force]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "filing_url",
            "accession_no",
            "source"
          ]
        }
      }
    },
    "/commands/kpi.extract": {
      "post": {
        "operationId": "finance_kpi_extract",
        "summary": "Extract KPI evidence from filings or transcripts",
        "description": "Use to collect KPI evidence from transcripts and filings with source snippets.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command.",
                    "enum": [
                      "transcripts",
                      "filings",
                      "both"
                    ]
                  },
                  "metrics": {
                    "type": "string",
                    "description": "Comma-separated KPI or metric names to search for.",
                    "default": "arr,nrr"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 30
                  },
                  "quarter": {
                    "type": "string",
                    "description": "Fiscal quarter label, such as Q1 or Q4.",
                    "default": "latest"
                  },
                  "form": {
                    "type": "string",
                    "description": "SEC form type.",
                    "default": "10-K"
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "KPI evidence snippets and history rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "kpi.extract",
          "usage": "finance kpi.extract SYMBOL [source=transcripts|filings|both metrics=arr,nrr limit=30 quarter=latest form=10-K]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "accession_no",
            "quarter",
            "metric"
          ]
        }
      }
    },
    "/commands/kpi.history": {
      "post": {
        "operationId": "finance_kpi_history",
        "summary": "Extract KPI evidence across recent transcripts",
        "description": "Use to collect KPI evidence from transcripts and filings with source snippets.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command.",
                    "default": "transcripts"
                  },
                  "metrics": {
                    "type": "string",
                    "description": "Comma-separated KPI or metric names to search for.",
                    "default": "arr,nrr"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 4
                  },
                  "per_document_limit": {
                    "type": "integer",
                    "description": "Maximum KPI evidence rows per source document.",
                    "default": 20
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "KPI evidence snippets and history rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "kpi.history",
          "usage": "finance kpi.history SYMBOL [source=transcripts metrics=arr,nrr limit=4 per_document_limit=20]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "accession_no",
            "quarter",
            "metric"
          ]
        }
      }
    },
    "/commands/market.ohlcv": {
      "post": {
        "operationId": "finance_market_ohlcv",
        "summary": "Fetch normalized OHLCV records for one or more symbols",
        "description": "Use for historical bars needed by backtests, event windows, and price context.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "timeframe": {
                    "type": "string",
                    "default": "1d",
                    "description": "Bar interval."
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date."
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date."
                  },
                  "limit": {
                    "type": "integer",
                    "default": 200,
                    "description": "Maximum bars when date bounds are not enough."
                  },
                  "provider": {
                    "type": "string",
                    "default": "auto",
                    "description": "Provider selection."
                  },
                  "include_attempts": {
                    "type": "boolean",
                    "default": false,
                    "description": "Include provider-attempt diagnostics."
                  },
                  "symbols": {
                    "type": "string",
                    "description": "One ticker or comma-separated tickers."
                  }
                },
                "required": [
                  "symbols"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Quote, bars, market status, regime, or sector heat data.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "market.ohlcv",
          "usage": "finance market.ohlcv SYMBOL[,SYMBOL...] [timeframe=1d start_date=YYYY-MM-DD end_date=YYYY-MM-DD limit=200 provider=auto include_attempts=false]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "date",
            "source",
            "provider"
          ]
        }
      }
    },
    "/commands/market.quote": {
      "post": {
        "operationId": "finance_market_quote",
        "summary": "Fetch quote via the best available provider",
        "description": "Use for a current provider quote or compact company market snapshot.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Quote, bars, market status, regime, or sector heat data.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "market.quote",
          "usage": "finance market.quote SYMBOL",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "source",
            "provider",
            "timestamp"
          ]
        }
      }
    },
    "/commands/market.regime": {
      "post": {
        "operationId": "finance_market_regime",
        "summary": "Show market regime context",
        "description": "Use for quotes, OHLCV, market status, broad regime, and sector heat context.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Market code.",
                    "default": "US"
                  },
                  "timeframe": {
                    "type": "string",
                    "description": "Provider-supported timeframe or research horizon.",
                    "default": "swing"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Quote, bars, market status, regime, or sector heat data.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "market.regime",
          "usage": "finance market.regime [MARKET=US] [TIMEFRAME=swing]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/market.sector_heat": {
      "post": {
        "operationId": "finance_market_sector_heat",
        "summary": "Show sector heat rankings",
        "description": "Use for quotes, OHLCV, market status, broad regime, and sector heat context.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Market code.",
                    "default": "US"
                  },
                  "lookback_days": {
                    "type": "integer",
                    "description": "Lookback window in calendar days.",
                    "default": 20
                  },
                  "group_by": {
                    "type": "string",
                    "description": "Aggregation grouping for analysis output.",
                    "default": "sector"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Quote, bars, market status, regime, or sector heat data.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "market.sector_heat",
          "usage": "finance market.sector_heat [MARKET=US] [LOOKBACK_DAYS=20] [GROUP_BY=sector]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/market.status": {
      "post": {
        "operationId": "finance_market_status",
        "summary": "Show Yahoo market open/close status and index summary",
        "description": "Use to check current market open/close state and major-index summary.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "market": {
                    "type": "string",
                    "description": "Market code.",
                    "default": "US"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Quote, bars, market status, regime, or sector heat data.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "market.status",
          "usage": "finance market.status [MARKET=US]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/news.analyze": {
      "post": {
        "operationId": "finance_news_analyze",
        "summary": "Analyze news volume, tone, context, or geography",
        "description": "Use for source-attributed news search and GDELT analysis windows.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "analysis": {
                    "type": "string",
                    "enum": [
                      "timeline",
                      "tone",
                      "context",
                      "geo",
                      "doc"
                    ],
                    "description": "Analysis mode."
                  },
                  "query": {
                    "type": "string",
                    "description": "Search query."
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "sector": {
                    "type": "string",
                    "description": "Sector key or sector name to query."
                  },
                  "mode": {
                    "type": "string",
                    "description": "Analysis mode."
                  },
                  "max_records": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 50
                  },
                  "timespan": {
                    "type": "string",
                    "description": "Relative provider lookback window such as 24H, 7D, or 1M.",
                    "enum": [
                      "30D",
                      "1W",
                      "1M",
                      "24H"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "format": "date",
                    "description": "Date.",
                    "default": "YYYY-MM-DD"
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date.",
                    "default": "YYYY-MM-DD"
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date.",
                    "default": "YYYY-MM-DD"
                  },
                  "start_datetime": {
                    "type": "string",
                    "description": "Inclusive start timestamp for precise provider queries."
                  },
                  "end_datetime": {
                    "type": "string",
                    "description": "Inclusive end timestamp for precise provider queries."
                  }
                },
                "required": [
                  "analysis"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "News records or analysis result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "news.analyze",
          "usage": "finance news.analyze analysis=timeline|tone|context|geo|doc [query=TEXT | symbol=SYMBOL | sector=SECTOR] [mode=MODE max_records=50 timespan=30D|1W|1M|24H date=YYYY-MM-DD start_date=YYYY-MM-DD end_date=YYYY-MM-DD start_datetime=YYYYMMDDHHMMSS end_datetime=YYYYMMDDHHMMSS]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "url",
            "source",
            "published_at",
            "seendate"
          ]
        }
      }
    },
    "/commands/news.search": {
      "post": {
        "operationId": "finance_news_search",
        "summary": "Search finance news through GDELT",
        "description": "Use for source-attributed news search and GDELT analysis windows.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Free-text news query."
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Ticker query."
                  },
                  "sector": {
                    "type": "string",
                    "description": "Sector query."
                  },
                  "max_records": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 50
                  },
                  "timespan": {
                    "type": "string",
                    "description": "Relative provider lookback window such as 24H, 7D, or 1M.",
                    "enum": [
                      "30D",
                      "1W",
                      "1M",
                      "24H"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "format": "date",
                    "description": "Date.",
                    "default": "YYYY-MM-DD"
                  },
                  "start_date": {
                    "type": "string",
                    "format": "date",
                    "description": "Start date.",
                    "default": "YYYY-MM-DD"
                  },
                  "end_date": {
                    "type": "string",
                    "format": "date",
                    "description": "End date.",
                    "default": "YYYY-MM-DD"
                  },
                  "start_datetime": {
                    "type": "string",
                    "description": "Inclusive start timestamp for precise provider queries."
                  },
                  "end_datetime": {
                    "type": "string",
                    "description": "Inclusive end timestamp for precise provider queries."
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "News records or analysis result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "news.search",
          "usage": "finance news.search [query=TEXT | symbol=SYMBOL | sector=SECTOR] [max_records=50 timespan=30D|1W|1M|24H date=YYYY-MM-DD start_date=YYYY-MM-DD end_date=YYYY-MM-DD start_datetime=YYYYMMDDHHMMSS end_datetime=YYYYMMDDHHMMSS]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "url",
            "source",
            "published_at",
            "seendate"
          ]
        }
      }
    },
    "/commands/price.context": {
      "post": {
        "operationId": "finance_price_context",
        "summary": "Return a source-linked evidence timeline around a date",
        "description": "Use when the user asks what filings, news, or transcripts were near a dated price move.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "date": {
                    "type": "string",
                    "format": "date",
                    "description": "Date."
                  },
                  "lookback": {
                    "type": "string",
                    "description": "Lookback window around the requested date.",
                    "default": "3D"
                  },
                  "news_limit": {
                    "type": "integer",
                    "description": "Maximum news records to include.",
                    "default": 5
                  },
                  "filing_limit": {
                    "type": "integer",
                    "description": "Maximum filing records to include.",
                    "default": 80
                  },
                  "transcript_limit": {
                    "type": "integer",
                    "description": "Maximum transcript records to include.",
                    "default": 12
                  }
                },
                "required": [
                  "symbol",
                  "date"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Price moves or dated evidence timeline.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "price.context",
          "usage": "finance price.context SYMBOL date=YYYY-MM-DD [lookback=3D news_limit=5 filing_limit=80 transcript_limit=12]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "date",
            "source",
            "url"
          ]
        }
      }
    },
    "/commands/price.moves": {
      "post": {
        "operationId": "finance_price_moves",
        "summary": "Find large deterministic close-to-close stock moves",
        "description": "Use for price move discovery and evidence timelines around a date.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "window": {
                    "type": "string",
                    "description": "Trading or text window size, depending on the command.",
                    "enum": [
                      "1d",
                      "3d",
                      "1w",
                      "1m"
                    ]
                  },
                  "years": {
                    "type": "integer",
                    "description": "Number of historical years to inspect.",
                    "default": 3
                  },
                  "threshold": {
                    "type": "string",
                    "description": "Move threshold. CLI accepts decimal or percent notation.",
                    "enum": [
                      8,
                      "8%"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 20
                  },
                  "provider": {
                    "type": "string",
                    "description": "Provider selection.",
                    "default": "auto"
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Price moves or dated evidence timeline.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "price.moves",
          "usage": "finance price.moves SYMBOL [window=1d|3d|1w|1m years=3 threshold=8|8% limit=20 provider=auto]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "date",
            "source",
            "url"
          ]
        }
      }
    },
    "/commands/research.plan": {
      "post": {
        "operationId": "finance_research_plan",
        "summary": "Return a deterministic research command checklist",
        "description": "Use before executing a complex public-company research workflow.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "style": {
                    "type": "string",
                    "default": "fundamental",
                    "description": "Value supplied for `style`."
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Research checklist.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "research.plan",
          "usage": "finance research.plan SYMBOL [style=fundamental]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/screen.predefined": {
      "post": {
        "operationId": "finance_screen_predefined",
        "summary": "List predefined Yahoo equity screens",
        "description": "Use to list and run Yahoo predefined equity screens.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo predefined screen metadata or quote rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "screen.predefined",
          "usage": "finance screen.predefined",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/screen.run": {
      "post": {
        "operationId": "finance_screen_run",
        "summary": "Run a predefined Yahoo equity screen",
        "description": "Use after screen.predefined when the user asks for Yahoo predefined screen results.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Search query."
                  },
                  "count": {
                    "type": "integer",
                    "description": "Maximum records requested.",
                    "default": 25
                  },
                  "offset": {
                    "type": "integer",
                    "description": "Result offset.",
                    "default": 0
                  },
                  "sort_field": {
                    "type": "string",
                    "description": "Field used to sort screen results."
                  },
                  "sort_asc": {
                    "type": "boolean",
                    "description": "Sort ascending when set.",
                    "default": false
                  }
                },
                "required": [
                  "query"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo predefined screen metadata or quote rows.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "screen.run",
          "usage": "finance screen.run QUERY [count=25 offset=0 sort_field=FIELD sort_asc=false]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/sector.industries": {
      "post": {
        "operationId": "finance_sector_industries",
        "summary": "List industries in a sector",
        "description": "Use for Yahoo sector keys, industries, overview data, ETFs, mutual funds, and top companies.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Provider key returned by the corresponding list command."
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo sector key, overview, industries, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sector.industries",
          "usage": "finance sector.industries KEY",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/sector.keys": {
      "post": {
        "operationId": "finance_sector_keys",
        "summary": "List Yahoo sector keys",
        "description": "Use for Yahoo sector keys, industries, overview data, ETFs, mutual funds, and top companies.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo sector key, overview, industries, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sector.keys",
          "usage": "finance sector.keys",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/sector.overview": {
      "post": {
        "operationId": "finance_sector_overview",
        "summary": "Fetch sector overview metadata",
        "description": "Use for Yahoo sector keys, industries, overview data, ETFs, mutual funds, and top companies.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Provider key returned by the corresponding list command."
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo sector key, overview, industries, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sector.overview",
          "usage": "finance sector.overview KEY",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/sector.table": {
      "post": {
        "operationId": "finance_sector_table",
        "summary": "Fetch sector top companies, funds, or reports",
        "description": "Use for Yahoo sector keys, industries, overview data, ETFs, mutual funds, and top companies.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Provider key returned by the corresponding list command."
                  },
                  "table": {
                    "type": "string",
                    "description": "Provider table name to return.",
                    "enum": [
                      "top_companies",
                      "top_etfs",
                      "top_mutual_funds",
                      "research_reports"
                    ]
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 25
                  }
                },
                "required": [
                  "key"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Yahoo sector key, overview, industries, or table result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sector.table",
          "usage": "finance sector.table KEY [table=top_companies|top_etfs|top_mutual_funds|research_reports limit=25]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": []
        }
      }
    },
    "/commands/sources.list": {
      "post": {
        "operationId": "finance_sources_list",
        "summary": "List finance data sources and capabilities",
        "description": "Use to inspect configured data sources and run provider health probes.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Provider status, capability list, or test result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sources.list",
          "usage": "finance sources.list",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment",
          "citation_fields": []
        }
      }
    },
    "/commands/sources.status": {
      "post": {
        "operationId": "finance_sources_status",
        "summary": "Show package and environment configuration for data sources",
        "description": "Use to report which providers are configured locally without making provider-specific claims.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Provider status, capability list, or test result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sources.status",
          "usage": "finance sources.status",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment",
          "citation_fields": []
        }
      }
    },
    "/commands/sources.test": {
      "post": {
        "operationId": "finance_sources_test",
        "summary": "Run small connectivity checks against one or all data sources",
        "description": "Use for provider connectivity checks when debugging setup.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "source": {
                    "type": "string",
                    "description": "Source key, path, or URL depending on command."
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "timeout": {
                    "type": "integer",
                    "description": "Provider test timeout in seconds.",
                    "default": 30
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Provider status, capability list, or test result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "sources.test",
          "usage": "finance sources.test [SOURCE|source=SOURCE] [symbol=AAPL timeout=30]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment",
          "citation_fields": []
        }
      }
    },
    "/commands/symbol.profile": {
      "post": {
        "operationId": "finance_symbol_profile",
        "summary": "Show real quote and SEC company metadata for a symbol",
        "description": "Use for a public-company profile or compact symbol snapshot.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Symbol profile or snapshot.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "symbol.profile",
          "usage": "finance symbol.profile SYMBOL",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "source",
            "provider"
          ]
        }
      }
    },
    "/commands/symbol.snapshot": {
      "post": {
        "operationId": "finance_symbol_snapshot",
        "summary": "Show real quote and company metadata for a symbol",
        "description": "Use for a public-company profile or compact symbol snapshot.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Symbol profile or snapshot.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "symbol.snapshot",
          "usage": "finance symbol.snapshot SYMBOL",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "source",
            "provider"
          ]
        }
      }
    },
    "/commands/transcripts.qa": {
      "post": {
        "operationId": "finance_transcripts_qa",
        "summary": "Extract analyst Q&A pairs from a transcript",
        "description": "Use for earnings-call transcript search, reading, and Q&A extraction.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "quarter": {
                    "type": "string",
                    "description": "Fiscal quarter label, such as Q1 or Q4.",
                    "default": "latest"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 10
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Transcript search, read, or Q&A result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "transcripts.qa",
          "usage": "finance transcripts.qa [SYMBOL] [url=URL] [quarter=latest limit=10]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "quarter",
            "speaker",
            "published_at"
          ]
        }
      }
    },
    "/commands/transcripts.read": {
      "post": {
        "operationId": "finance_transcripts_read",
        "summary": "Read a transcript and split prepared remarks / Q&A",
        "description": "Use for earnings-call transcript search, reading, and Q&A extraction.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Remote URL."
                  },
                  "quarter": {
                    "type": "string",
                    "description": "Fiscal quarter label, such as Q1 or Q4.",
                    "default": "latest"
                  },
                  "max_chars": {
                    "type": "integer",
                    "description": "Maximum text characters to return.",
                    "default": 12000
                  },
                  "include_turns": {
                    "type": "boolean",
                    "description": "Include transcript speaker turns.",
                    "default": false
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Transcript search, read, or Q&A result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "transcripts.read",
          "usage": "finance transcripts.read [SYMBOL] [url=URL] [quarter=latest max_chars=12000 include_turns=false]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "quarter",
            "speaker",
            "published_at"
          ]
        }
      }
    },
    "/commands/transcripts.search": {
      "post": {
        "operationId": "finance_transcripts_search",
        "summary": "Search public earnings-call transcripts",
        "description": "Use for earnings-call transcript search, reading, and Q&A extraction.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum records to return.",
                    "default": 4
                  },
                  "debug": {
                    "type": "boolean",
                    "description": "Include debug details.",
                    "default": false
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Transcript search, read, or Q&A result.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "transcripts.search",
          "usage": "finance transcripts.search SYMBOL [limit=4 debug=false]",
          "side_effects": "network_read_only",
          "auth_required": "optional_environment_or_public_provider",
          "citation_fields": [
            "symbol",
            "url",
            "quarter",
            "speaker",
            "published_at"
          ]
        }
      }
    },
    "/commands/valuation.dcf": {
      "post": {
        "operationId": "finance_valuation_dcf",
        "summary": "Calculate DCF enterprise value from forecast cash flows",
        "description": "Use only for deterministic DCF math from explicit cash flows and discount assumptions.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cashflows": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "Forecast cash flows. CLI accepts K/M/B suffixes."
                  },
                  "discount_rate": {
                    "type": "number",
                    "description": "Discount rate; CLI accepts decimal or percent."
                  },
                  "terminal_growth": {
                    "type": "number",
                    "description": "Perpetuity growth rate."
                  },
                  "exit_multiple": {
                    "type": "number",
                    "description": "Exit multiple alternative to terminal growth."
                  }
                },
                "required": [
                  "cashflows",
                  "discount_rate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Valuation calculation result and assumptions.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "valuation.dcf",
          "usage": "finance valuation.dcf cashflows=100M,120M,140M discount_rate=10% [terminal_growth=3%|exit_multiple=15]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/valuation.irr": {
      "post": {
        "operationId": "finance_valuation_irr",
        "summary": "Calculate IRR for periodic cash flows",
        "description": "Use for deterministic valuation math once assumptions are explicit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cashflows": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "Cash-flow series. CLI accepts comma-separated K/M/B suffixed values."
                  }
                },
                "required": [
                  "cashflows"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Valuation calculation result and assumptions.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "valuation.irr",
          "usage": "finance valuation.irr cashflows=-100M,30M,40M,50M",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/valuation.multiples": {
      "post": {
        "operationId": "finance_valuation_multiples",
        "summary": "Calculate current sales multiples from market cap and revenue",
        "description": "Use for deterministic valuation math once assumptions are explicit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  }
                },
                "required": [
                  "symbol"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Valuation calculation result and assumptions.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "valuation.multiples",
          "usage": "finance valuation.multiples SYMBOL",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/valuation.npv": {
      "post": {
        "operationId": "finance_valuation_npv",
        "summary": "Calculate NPV for periodic cash flows",
        "description": "Use for deterministic valuation math once assumptions are explicit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cashflows": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "Cash-flow series. CLI accepts comma-separated K/M/B suffixed values."
                  },
                  "discount_rate": {
                    "type": "number",
                    "description": "Discount rate. CLI accepts decimal or percent."
                  }
                },
                "required": [
                  "cashflows",
                  "discount_rate"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Valuation calculation result and assumptions.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "valuation.npv",
          "usage": "finance valuation.npv cashflows=-100M,30M,40M,50M discount_rate=10%",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/valuation.scenario": {
      "post": {
        "operationId": "finance_valuation_scenario",
        "summary": "Build a simple bull/base/bear sales-multiple scenario table",
        "description": "Use for deterministic valuation math once assumptions are explicit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "description": "Ticker symbol."
                  },
                  "revenue": {
                    "type": "number",
                    "description": "Reported, assumed, or user-supplied revenue input."
                  },
                  "bear_multiple": {
                    "type": "number",
                    "description": "Bear-case valuation multiple."
                  },
                  "base_multiple": {
                    "type": "number",
                    "description": "Base-case valuation multiple."
                  },
                  "bull_multiple": {
                    "type": "number",
                    "description": "Value supplied for `bull_multiple`."
                  },
                  "shares": {
                    "type": "number",
                    "description": "Share count used for per-share valuation output.",
                    "default": "580M"
                  }
                },
                "required": [
                  "symbol",
                  "revenue",
                  "bear_multiple",
                  "base_multiple",
                  "bull_multiple"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Valuation calculation result and assumptions.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "valuation.scenario",
          "usage": "finance valuation.scenario SYMBOL revenue=2.2B bear_multiple=7 base_multiple=10 bull_multiple=13 [shares=580M]",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    },
    "/commands/valuation.wacc": {
      "post": {
        "operationId": "finance_valuation_wacc",
        "summary": "Calculate weighted average cost of capital",
        "description": "Use for deterministic valuation math once assumptions are explicit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "equity_value": {
                    "type": "number",
                    "description": "Equity market value used in WACC or valuation math."
                  },
                  "debt_value": {
                    "type": "number",
                    "description": "Debt value used in WACC or valuation math."
                  },
                  "cost_of_equity": {
                    "type": "string",
                    "description": "Cost of equity. CLI accepts decimal or percent."
                  },
                  "cost_of_debt": {
                    "type": "string",
                    "description": "Cost of debt. CLI accepts decimal or percent."
                  },
                  "tax_rate": {
                    "type": "number",
                    "default": 0,
                    "description": "Tax rate; CLI accepts decimal or percent."
                  }
                },
                "required": [
                  "equity_value",
                  "debt_value",
                  "cost_of_equity",
                  "cost_of_debt"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finance CLI result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "error",
                    "warnings"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when the command completed successfully."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "object",
                          "description": "Valuation calculation result and assumptions.",
                          "additionalProperties": true
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Human-readable error when ok is false."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Non-fatal issues."
                    }
                  }
                }
              }
            }
          }
        },
        "x-finance-cli": {
          "command": "valuation.wacc",
          "usage": "finance valuation.wacc equity_value=10B debt_value=1B cost_of_equity=10% cost_of_debt=5% tax_rate=21%",
          "side_effects": "pure_calculation",
          "auth_required": "none",
          "citation_fields": []
        }
      }
    }
  }
}
