@pipeworx/mcp-edgar 0.3.9 → 0.3.10
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.
- package/README.md +2 -2
- package/package.json +3 -3
- package/server.json +1 -1
- package/src/index.ts +22 -2
- package/src/server.ts +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Securities and Exchange Commission's filings database. Every public company in the US files here, every filing is timestamped and immutable, and every disclosure (revenue, debt, risk factors, executive compensation, M&A activity, insider trading) is structured for machine retrieval. Free and authoritative.
|
|
4
4
|
|
|
5
|
-
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1807+ live data sources. This is an independent, unofficial integration — not affiliated with, endorsed by, or published by the upstream provider.
|
|
6
6
|
|
|
7
7
|
## Why this matters for AI agents
|
|
8
8
|
|
|
@@ -106,7 +106,7 @@ directly, instead of just this one's:
|
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Both URLs reach the same gateway and the same
|
|
109
|
+
Both URLs reach the same gateway and the same 1807+ data sources. The
|
|
110
110
|
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
111
111
|
reaches all of them from either one.
|
|
112
112
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipeworx/mcp-edgar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "EDGAR MCP — SEC EDGAR public APIs (free, no auth)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
27
|
},
|
|
28
28
|
"pipeworx": {
|
|
29
|
-
"sourceHash": "v1-
|
|
30
|
-
"sourceCommit": "
|
|
29
|
+
"sourceHash": "v1-c6ffe46614ee14db9190ceb27485537bf8164b74f6f5768addd234dad2987dff",
|
|
30
|
+
"sourceCommit": "8dbe088fb6f9d2c88f934173742329b4e20a67d6"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.pipeworx-io/edgar",
|
|
4
4
|
"title": "Edgar",
|
|
5
5
|
"description": "EDGAR MCP — SEC EDGAR public APIs (free, no auth)",
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.10",
|
|
7
7
|
"websiteUrl": "https://pipeworx.io/packs/edgar",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/pipeworx-io/mcp-edgar",
|
package/src/index.ts
CHANGED
|
@@ -699,6 +699,16 @@ const normalize = (s: string): string =>
|
|
|
699
699
|
* exact (4) > prefix (3) > whole-word (2) > substring (1). Ties break by shortest
|
|
700
700
|
* name — the primary entity (e.g. "Apple Inc." over "Apple Hospitality REIT").
|
|
701
701
|
* Returns only items that match at all, best first. Pure (no I/O).
|
|
702
|
+
*
|
|
703
|
+
* `prefix` requires a WORD BOUNDARY (`n.startsWith(q + ' ')`), not a bare
|
|
704
|
+
* `startsWith`. A bare `startsWith` let "ZOOM" claim "ZOOMCAR HOLDINGS INC" at
|
|
705
|
+
* the SAME tier as "Apple" claiming "APPLE INC." — "Zoomcar" is a different
|
|
706
|
+
* word that happens to begin with the same letters, not the brand name plus a
|
|
707
|
+
* corporate-form suffix. That conflation is what sent resolve_entity("Zoom")
|
|
708
|
+
* to Zoomcar and resolve_entity("Audi") to AudioEye Inc (fleet #2776's
|
|
709
|
+
* mis-resolution fixture) — both now correctly fall through to the weaker
|
|
710
|
+
* `substring` tier instead of tying with a genuine word-boundary prefix hit
|
|
711
|
+
* like "Palantir" -> "Palantir Technologies Inc." (fleet #3100).
|
|
702
712
|
*/
|
|
703
713
|
function rankMatches<T>(
|
|
704
714
|
query: string,
|
|
@@ -714,7 +724,7 @@ function rankMatches<T>(
|
|
|
714
724
|
let kind: MatchKind | null = null;
|
|
715
725
|
let score = 0;
|
|
716
726
|
if (n === q) { kind = 'exact'; score = 4; }
|
|
717
|
-
else if (n.startsWith(q)) { kind = 'prefix'; score = 3; }
|
|
727
|
+
else if (n.startsWith(`${q} `)) { kind = 'prefix'; score = 3; }
|
|
718
728
|
else if (n.includes(` ${q} `) || n.endsWith(` ${q}`)) { kind = 'word'; score = 2; }
|
|
719
729
|
else if (n.includes(q)) { kind = 'substring'; score = 1; }
|
|
720
730
|
if (kind) scored.push({ item, kind, score, len: name.length });
|
|
@@ -731,7 +741,15 @@ interface SecEntity {
|
|
|
731
741
|
cik_padded: string;
|
|
732
742
|
company_name: string;
|
|
733
743
|
matched_by: 'ticker' | 'company_name';
|
|
734
|
-
|
|
744
|
+
/**
|
|
745
|
+
* The `rankMatches` kind that won, when `matched_by` is `'company_name'`
|
|
746
|
+
* (a ticker hit has no kind — it did not go through ranking at all). Lets a
|
|
747
|
+
* caller tell a word-boundary PREFIX hit ("Palantir" -> "Palantir
|
|
748
|
+
* Technologies Inc.") from a weaker `word`/`substring` guess, which
|
|
749
|
+
* `matched_by: 'company_name'` alone cannot (fleet #3100).
|
|
750
|
+
*/
|
|
751
|
+
matched_kind?: MatchKind;
|
|
752
|
+
alternatives?: { ticker: string; company_name: string; cik: string; kind: MatchKind }[];
|
|
735
753
|
}
|
|
736
754
|
|
|
737
755
|
const SEC_TICKERS_URL = 'https://www.sec.gov/files/company_tickers.json';
|
|
@@ -767,10 +785,12 @@ async function resolveSecEntity(
|
|
|
767
785
|
const ranked = rankMatches(query, rows, (r) => r.title);
|
|
768
786
|
if (ranked.length) {
|
|
769
787
|
const best = toEntity(ranked[0].item, 'company_name');
|
|
788
|
+
best.matched_kind = ranked[0].kind;
|
|
770
789
|
const alts = ranked.slice(1, 4).map((m) => ({
|
|
771
790
|
ticker: m.item.ticker,
|
|
772
791
|
company_name: m.item.title,
|
|
773
792
|
cik: String(m.item.cik_str),
|
|
793
|
+
kind: m.kind,
|
|
774
794
|
}));
|
|
775
795
|
if (alts.length) best.alternatives = alts;
|
|
776
796
|
return best;
|