data-mcp icon indicating copy to clipboard operation
data-mcp copied to clipboard

Enforce SEC filing read locators

Open gyx09212214-prog opened this issue 5 months ago • 0 comments

Summary

  • enforce the existing sec_filing_read locator contract in the Zod schema
  • require year for 10-K reads when accession_number is omitted
  • require both year and quarter for 10-Q reads when accession_number is omitted
  • add regression coverage for missing 10-K and 10-Q locators, plus the accepted 10-K year lookup

Why

The tool description already tells agents that 10-K reads need year and 10-Q reads need year + quarter unless they pass an exact accession_number. The schema did not enforce that contract, so an MCP client could send an under-specified request to the Web API and only discover the problem downstream.

This keeps the progressive disclosure flow tighter: browse first when needed, or pass a complete filing locator before calling sec_filing_read.

Tests

  • node --import tsx --test src\\tools\\sec-tools.test.ts
  • npm run typecheck
  • npm run lint
  • npm test

gyx09212214-prog avatar Jun 10 '26 03:06 gyx09212214-prog