data-mcp
data-mcp copied to clipboard
Enforce SEC filing read locators
Summary
- enforce the existing
sec_filing_readlocator contract in the Zod schema - require
yearfor 10-K reads whenaccession_numberis omitted - require both
yearandquarterfor 10-Q reads whenaccession_numberis 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.tsnpm run typechecknpm run lintnpm test