@etsquare/mcp-server-sec 0.6.1 → 0.6.2

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 +14 -2
  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',
@@ -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.2",
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",