@etsquare/mcp-server-sec 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +22 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -360,6 +360,15 @@ const server = new McpServer({
360
360
  name: 'etsquare-mcp-sec',
361
361
  version: '0.6.0',
362
362
  });
363
+ const CITATION_POLICY = 'Citation policy (required): When `cite: true` appears in the response, you MUST include ' +
364
+ 'the sec_url for every filing referenced in the answer. Cite each URL inline with its claim.';
365
+ const baseRegisterTool = server.registerTool.bind(server);
366
+ server.registerTool = ((name, config, handler) => {
367
+ const description = typeof config?.description === 'string' && config.description.trim().length > 0
368
+ ? `${config.description}\n\n${CITATION_POLICY}`
369
+ : CITATION_POLICY;
370
+ return baseRegisterTool(name, { ...config, description }, handler);
371
+ });
363
372
  // ─── Tool 1: Company Lookup ─────────────────────────────────────────────────
364
373
  server.registerTool('etsquare_lookup_company', {
365
374
  title: 'Look Up Company Ticker',
@@ -410,17 +419,17 @@ server.registerTool('etsquare_search', {
410
419
  'Returns verbatim filing text with citations — best for qualitative research.\n\n' +
411
420
  'Execution contract (required):\n' +
412
421
  '- mode_lock: NARRATIVE (recommended) | HYBRID\n' +
413
- '- scope_lock: COMPANY (specific tickers) | INDUSTRY (SIC sector) | MACRO (cross-market)\n\n' +
414
- 'For canonical financial statements (income statement, balance sheet, cash flow), use etsquare_financial_statements.\n' +
415
- 'For custom financial queries or peer comparisons, use etsquare_discover_metrics + etsquare_execute_metrics.\n\n' +
416
- 'For INDUSTRY scope, use sector to target a specific industry (e.g., sector="semiconductors"). ' +
417
- 'Use tickers to scope to specific companies (resolve names first with etsquare_lookup_company). ' +
418
- 'Results include filing text plus safe citation metadata such as chunk_id, accession number, and SEC URL for follow-up retrieval.\n\n' +
419
- 'Set response_format="structured" for typed JSON with search_context, layout hints, and chart-ready data.',
422
+ '- scope_lock: COMPANY | INDUSTRY | MACRO\n\n' +
423
+ 'COMPANY + tickers = precision. INDUSTRY + sector = breadth. ' +
424
+ 'When precision matters, supply tickers.\n\n' +
425
+ 'For financial statements, use etsquare_financial_statements. ' +
426
+ 'For metrics/comparisons, use etsquare_discover_metrics + etsquare_execute_metrics.\n\n' +
427
+ 'Results include filing text, chunk_id, accession number, and SEC URL.\n' +
428
+ 'Set response_format="structured" for typed JSON.',
420
429
  inputSchema: {
421
430
  query: z.string().min(3).describe('What to search for in SEC filings (e.g., "customer concentration risk", "Show NVDA revenue trend")'),
422
431
  mode_lock: z.enum(['NARRATIVE', 'HYBRID']).describe('NARRATIVE for text search, HYBRID for text + any available metrics'),
423
- scope_lock: z.enum(['COMPANY', 'INDUSTRY', 'MACRO']).describe('COMPANY for specific tickers, INDUSTRY for SIC sector-wide, MACRO for cross-market'),
432
+ scope_lock: z.enum(['COMPANY', 'INDUSTRY', 'MACRO']).describe('COMPANY = specific tickers (precision). INDUSTRY = sector-wide (breadth). MACRO = cross-market.'),
424
433
  top_k: z.number().min(1).max(50).default(5).describe('Number of results to return (default: 5)'),
425
434
  tickers: z.array(z.string()).optional().describe('Limit to specific companies by ticker (e.g., ["AAPL", "MSFT"])'),
426
435
  doc_types: z.array(z.string()).optional().describe('Limit by SEC form type: "10-k", "10-q", "8-k"'),
@@ -496,6 +505,7 @@ server.registerTool('etsquare_search', {
496
505
  ? buildColumnMeta(result.xbrl_output_schema?.columns || [], xbrlMetrics)
497
506
  : null;
498
507
  const structured = {
508
+ cite: true,
499
509
  search_context: buildSearchContext(result, input.query),
500
510
  results: searchResults
501
511
  .slice(0, input.top_k || 5)
@@ -1046,6 +1056,7 @@ server.registerTool('etsquare_kpi_extractions', {
1046
1056
  content: [{
1047
1057
  type: 'text',
1048
1058
  text: JSON.stringify({
1059
+ cite: true,
1049
1060
  count,
1050
1061
  filters,
1051
1062
  extractions,
@@ -1244,7 +1255,7 @@ server.registerTool('etsquare_query_kpis', {
1244
1255
  return {
1245
1256
  content: [{
1246
1257
  type: 'text',
1247
- text: JSON.stringify({ count, data }, null, 2),
1258
+ text: JSON.stringify({ cite: true, count, data }, null, 2),
1248
1259
  }],
1249
1260
  };
1250
1261
  }
@@ -1402,6 +1413,7 @@ server.registerTool('etsquare_execute_metrics', {
1402
1413
  const autoHint = deriveMetricsVizHint(rows, { columns: columnMeta });
1403
1414
  const colNames = columnMeta.map((c) => c.name);
1404
1415
  const structured = {
1416
+ cite: true,
1405
1417
  template_id: input.template_id,
1406
1418
  columns: columnMeta,
1407
1419
  rows,
@@ -1817,7 +1829,7 @@ server.registerTool('etsquare_weekly_brief', {
1817
1829
  // ── Structured response path ──
1818
1830
  if (input.response_format === 'structured') {
1819
1831
  log('info', `Weekly brief returned: ${(brief.notable || []).length} notable, ${(brief.edge_signals || []).length} edge signals`);
1820
- return { content: [{ type: 'text', text: JSON.stringify(output, null, 2) }] };
1832
+ return { content: [{ type: 'text', text: JSON.stringify({ cite: true, ...output }, null, 2) }] };
1821
1833
  }
1822
1834
  // ── Text response path ──
1823
1835
  const lines = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsquare/mcp-server-sec",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "description": "MCP server for Claude Desktop: search SEC filing sections, financial statements, insider trades, institutional ownership, earnings actuals, XBRL metrics, and company lookup.",
6
6
  "main": "dist/index.js",