@cyanheads/nonprofit-explorer-mcp-server 0.1.9 → 0.2.0
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/AGENTS.md +43 -20
- package/CLAUDE.md +43 -20
- package/Dockerfile +111 -39
- package/README.md +10 -7
- package/changelog/0.1.x/0.1.10.md +35 -0
- package/changelog/0.1.x/0.1.9.md +3 -3
- package/changelog/0.2.x/0.2.0.md +31 -0
- package/dist/index.js +3 -7
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nonprofit-get-filings.tool.d.ts +19 -1
- package/dist/mcp-server/tools/definitions/nonprofit-get-filings.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nonprofit-get-filings.tool.js +72 -20
- package/dist/mcp-server/tools/definitions/nonprofit-get-filings.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/nonprofit-get-organization.tool.d.ts +16 -1
- package/dist/mcp-server/tools/definitions/nonprofit-get-organization.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/nonprofit-get-organization.tool.js +35 -8
- package/dist/mcp-server/tools/definitions/nonprofit-get-organization.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/{nonprofit-search.tool.d.ts → nonprofit-search-organizations.tool.d.ts} +17 -3
- package/dist/mcp-server/tools/definitions/nonprofit-search-organizations.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/{nonprofit-search.tool.js → nonprofit-search-organizations.tool.js} +20 -4
- package/dist/mcp-server/tools/definitions/nonprofit-search-organizations.tool.js.map +1 -0
- package/dist/services/nonprofit-explorer/nonprofit-explorer-service.d.ts +3 -3
- package/dist/services/nonprofit-explorer/nonprofit-explorer-service.d.ts.map +1 -1
- package/dist/services/nonprofit-explorer/nonprofit-explorer-service.js +44 -48
- package/dist/services/nonprofit-explorer/nonprofit-explorer-service.js.map +1 -1
- package/dist/services/nonprofit-explorer/types.d.ts +12 -0
- package/dist/services/nonprofit-explorer/types.d.ts.map +1 -1
- package/package.json +14 -11
- package/server.json +11 -25
- package/dist/mcp-server/tools/definitions/nonprofit-search.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/nonprofit-search.tool.js.map +0 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/nonprofit-explorer-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/nonprofit-explorer-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
|
|
30
30
|
## Overview
|
|
31
31
|
|
|
32
|
-
IRS Form 990 data for 1.8M+ tax-exempt organizations, via the ProPublica Nonprofit Explorer API. Search by name, fetch an org's financial snapshot, and pull its full filing history
|
|
32
|
+
IRS Form 990 data for 1.8M+ tax-exempt organizations, via the ProPublica Nonprofit Explorer API. Search by name, fetch an org's financial snapshot, and pull its full filing history.
|
|
33
33
|
|
|
34
34
|
### Tools
|
|
35
35
|
|
|
36
36
|
| Tool | Description |
|
|
37
37
|
|:---|:---|
|
|
38
|
-
| `
|
|
38
|
+
| `nonprofit_search_organizations` | Search 1.8M+ IRS-recognized tax-exempt organizations by name, keyword, city, or phrase with optional state, NTEE sector, and 501(c) filters |
|
|
39
39
|
| `nonprofit_get_organization` | Full profile for one org by EIN: legal identity, IRS classification, ruling date, and a financial snapshot from the most recent Form 990 |
|
|
40
40
|
| `nonprofit_get_filings` | All Form 990 filings for an org by EIN: year-by-year financials, revenue breakdown, executive compensation, and source PDF links |
|
|
41
41
|
|
|
42
42
|
## Capability reference
|
|
43
43
|
|
|
44
|
-
### `
|
|
44
|
+
### `nonprofit_search_organizations` <sub>tool</sub>
|
|
45
45
|
|
|
46
46
|
- Full-text query — supports quoted phrases (`"Red Cross"`), required terms (`+evanston`), excluded terms (`-dental`)
|
|
47
47
|
- Optional filters: US state/territory or military postal code (`ZZ` for foreign entities; a code outside that set is rejected rather than silently returning national results), NTEE major sector (1–10), 501(c) subsection code (`3` covers both public charities and private foundations — see `foundation_type` on `nonprofit_get_organization` to tell them apart)
|
|
@@ -54,11 +54,11 @@ IRS Form 990 data for 1.8M+ tax-exempt organizations, via the ProPublica Nonprof
|
|
|
54
54
|
|
|
55
55
|
### `nonprofit_get_organization` <sub>tool</sub>
|
|
56
56
|
|
|
57
|
-
- Accepts EIN as integer (`530196605`) or string with or without hyphen (`"53-0196605"`); use `
|
|
57
|
+
- Accepts EIN as integer (`530196605`) or string with or without hyphen (`"53-0196605"`); use `nonprofit_search_organizations` first if you only have an org name
|
|
58
58
|
- Returns legal identity, address, NTEE code, 501(c) type, and IRS ruling date
|
|
59
59
|
- IRS Business Master File standing: deductibility (including the deductible-by-treaty case), exemption status, and public-charity vs. private-foundation classification — each decoded from its IRS code with the raw code retained
|
|
60
60
|
- Financial snapshot from the most recent Form 990: revenue, expenses, assets, liabilities, net assets, plus the source PDF link
|
|
61
|
-
- `filing_count`
|
|
61
|
+
- `filing_count` counts filings with extracted data; `filing_count_pdf_only` separately counts PDFs without financial extracts. Use `nonprofit_get_filings` for those links; PDF-only histories have no financial snapshot
|
|
62
62
|
- Data lags 1–2 years — `tax_prd_yr` in the snapshot is the fiscal year of the filing, not the current year
|
|
63
63
|
|
|
64
64
|
---
|
|
@@ -66,6 +66,8 @@ IRS Form 990 data for 1.8M+ tax-exempt organizations, via the ProPublica Nonprof
|
|
|
66
66
|
### `nonprofit_get_filings` <sub>tool</sub>
|
|
67
67
|
|
|
68
68
|
- All Form 990 filings with extracted data, sorted newest first — per filing: revenue, expenses, assets, liabilities, net assets, revenue breakdown (contributions, program service, investment income), and the source PDF link
|
|
69
|
+
- Financial fields follow each return's form type. For 990-PF, investment income is savings interest plus dividends and securities interest (Part I column (a), lines 3–4); both components must be extracted. It excludes capital gains, rents, and net investment income
|
|
70
|
+
- 990-PF filings include `grants_paid`, `distributable_amount`, `fair_market_value_assets`, and `net_investment_income`. The distributable amount is a payout requirement, not actual payments or a compliance measure
|
|
69
71
|
- `program_expense_ratio` is always `null` — ProPublica returns no Form 990 Part IX program-service expense total, so the program/management/fundraising split is only in the source PDF
|
|
70
72
|
- Executive compensation summary with field-name transparency and a note pointing to Schedule J for per-officer detail
|
|
71
73
|
- `filings_pdf_only` lists older filings with a PDF but no extracted data
|
|
@@ -173,7 +175,7 @@ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
|
|
|
173
175
|
|
|
174
176
|
### Prerequisites
|
|
175
177
|
|
|
176
|
-
- [Bun v1.
|
|
178
|
+
- [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
177
179
|
- No API key required — ProPublica Nonprofit Explorer is a keyless public API.
|
|
178
180
|
|
|
179
181
|
### Installation
|
|
@@ -217,6 +219,7 @@ All configuration is validated at startup. Key environment variables:
|
|
|
217
219
|
| `MCP_AUTH_MODE` | Authentication: `none`, `jwt`, or `oauth` | `none` |
|
|
218
220
|
| `MCP_LOG_LEVEL` | Log level (`debug`, `info`, `warning`, `error`, etc.) | `info` |
|
|
219
221
|
| `LOGS_DIR` | Directory for log files (Node.js only) | `<project-root>/logs` |
|
|
222
|
+
| `LOG_TOOL_FAILURE_PAYLOADS` | Log each failed tool call's arguments and result, redacted by key name and capped at `LOG_TOOL_FAILURE_PAYLOAD_MAX_BYTES` (default `16384`). A secret inside a free-form value is not redacted. | `false` |
|
|
220
223
|
| `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `cloudflare-kv/r2/d1` | `in-memory` |
|
|
221
224
|
| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) | `false` |
|
|
222
225
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Adopts @cyanheads/mcp-ts-core ^0.13.14: an integer sent for query, a numeric-string page, and null optional filters are now repaired instead of rejected, and every tool error carries a request ID. The Docker image installs dependencies in a build-platform stage, and the MCP Registry HTTP entry now starts the HTTP transport."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.1.10 — 2026-10-08
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **Tool arguments are repaired instead of rejected in three cases**: an integer sent for `query` becomes its digits (`4711` searches for "4711"), a numeric string for `page` becomes the integer (`"1"` → page 1), and `null` at an optional filter (`state`, `ntee_category`, `subsection_code`) is treated as absent.
|
|
12
|
+
- **Tool error results carry `data.requestId`**, and the error text closes with `request <id>`.
|
|
13
|
+
- **Argument-rejection hints name the field path**, e.g. `Send page as a number, not a boolean.`
|
|
14
|
+
- **Service and tool throw sites no longer forward `ctx.recoveryFor(…)`**; the framework fills the declared `recovery` hint for the thrown `reason`. Callers see the same hint text as before.
|
|
15
|
+
- **`Dockerfile` installs production dependencies in a `deps` stage on `$BUILDPLATFORM`**, using the new `scripts/install-otel.ts` and `scripts/prune-musl-packages.ts`. Multi-arch builds no longer run Bun under emulation, and the image drops the unused musl native bindings.
|
|
16
|
+
- **Bun `1.4.0` → `1.4.2`** in `packageManager`, the Docker base images (`oven/bun:1.4.2`), and the README badge.
|
|
17
|
+
- **`package.json` `files` excludes `dist/*.mcpb`**; `.mcpbignore` excludes `.cache/`, `coverage/`, `tests/`, `docs/idea.md`, and `logs/`; `.gitignore` and `.dockerignore` ignore every `.env*` file except the templates.
|
|
18
|
+
- **`.github/workflows/codeql.yml` runs `actions` and `javascript-typescript` as a matrix**, each uploading under `/language:<language>`.
|
|
19
|
+
- **`.env.example` and the README document** the framework's logging, request-state, resumability, and OTLP variables, including `LOG_TOOL_FAILURE_PAYLOADS`.
|
|
20
|
+
- Framework skills, devcheck and lint scripts, `CLAUDE.md`, and `AGENTS.md` synced to `@cyanheads/mcp-ts-core` 0.13.14; `package.json` gains `audit:fix` and `start` scripts.
|
|
21
|
+
|
|
22
|
+
## Fixed
|
|
23
|
+
|
|
24
|
+
- **MCP Registry `server.json`**: both npm package entries now use `"runtimeHint": "npx"` with no `packageArguments`, and the `streamable-http` entry sets `MCP_TRANSPORT_TYPE` to `http`. The package bin ignored the former `run start:*` arguments, so the HTTP entry never selected the HTTP transport.
|
|
25
|
+
|
|
26
|
+
## Dependencies
|
|
27
|
+
|
|
28
|
+
- `@cyanheads/mcp-ts-core` `^0.13.6` → `^0.13.14`
|
|
29
|
+
- `pino-pretty` `^13.1.3` → `^13.2.0`
|
|
30
|
+
- `@biomejs/biome` `^2.5.14` → `^2.5.15` (dev)
|
|
31
|
+
- `@socketsecurity/bun-security-scanner` `^1.1.2` → `^1.1.3` (dev)
|
|
32
|
+
- `@types/node` `^26.6.1` → `^26.6.4` (dev)
|
|
33
|
+
- `ignore` `^7.0.9` → `^7.0.12` (dev)
|
|
34
|
+
- `tsc-alias` `^1.9.5` → `^1.9.7` (dev)
|
|
35
|
+
- `vitest` `^5.0.1` → `^5.0.3` (dev)
|
package/changelog/0.1.x/0.1.9.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
summary: "Adopts @cyanheads/mcp-ts-core ^0.13.6 —
|
|
3
|
-
breaking:
|
|
2
|
+
summary: "Adopts @cyanheads/mcp-ts-core ^0.13.6 — a rejected tool call now names the reason and carries a schema-derived recovery hint, tool error text states the reason and retryability, unknown and misspelled argument keys are repaired before a call fails, and a mid-flight cancellation classifies RequestCancelled."
|
|
3
|
+
breaking: false
|
|
4
4
|
security: false
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ security: false
|
|
|
8
8
|
|
|
9
9
|
## Changed
|
|
10
10
|
|
|
11
|
-
- **
|
|
11
|
+
- **An argument rejection carries `data.reason: "invalid_arguments"` and a schema-derived recovery hint**, rendered as a `Recovery:` line in `content[]`. A required field omitted from an enum now renders as missing rather than as a wrong choice, and a rejection against alternative shapes renders each branch's own message instead of a bare `Invalid input`.
|
|
12
12
|
- **Tool error text closes with `(reason … · not retryable)`** whenever the thrown error's data carries a `reason` or a boolean `retryable`.
|
|
13
13
|
- **Tool arguments pass a pre-validation step before schema parsing** — a client-added root key is dropped, a case-style key alias is rewritten, and a JSON-stringified array argument is repaired once before a call fails.
|
|
14
14
|
- **A request cancelled mid-flight classifies `RequestCancelled` (-32011)** instead of a generic internal error.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Form-aware nonprofit financials and separate PDF-only filing counts."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.0 — 2026-10-21
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **990-PF financials:** expose `grants_paid`, `distributable_amount`, `fair_market_value_assets`, and `net_investment_income`; the distributable amount is a payout requirement, not actual payments or a compliance measure ([#19](https://github.com/cyanheads/nonprofit-explorer-mcp-server/issues/19)).
|
|
12
|
+
- **`filing_count_pdf_only`:** count PDFs separately from extracted filings and direct PDF-only profiles to filing links without inferring a financial snapshot ([#21](https://github.com/cyanheads/nonprofit-explorer-mcp-server/issues/21)).
|
|
13
|
+
|
|
14
|
+
## Changed
|
|
15
|
+
|
|
16
|
+
- **Search tool:** Rename `nonprofit_search` to `nonprofit_search_organizations`; update callers to use the new name ([#16](https://github.com/cyanheads/nonprofit-explorer-mcp-server/issues/16)).
|
|
17
|
+
- **Development guidance:** synchronize framework references and release procedures; use Bun 1.4.2 → 1.4.3 for development and container images.
|
|
18
|
+
|
|
19
|
+
## Fixed
|
|
20
|
+
|
|
21
|
+
- **Form-specific financials:** select 990, 990-EZ, and 990-PF source fields per filing; preserve reported zero and missing values. PF investment income requires both savings-interest and dividend components ([#18](https://github.com/cyanheads/nonprofit-explorer-mcp-server/issues/18)).
|
|
22
|
+
- **Service failures:** omit request URLs from service error data and debug metadata; keep network exceptions as internal causes behind a stable public message ([#14](https://github.com/cyanheads/nonprofit-explorer-mcp-server/issues/14)).
|
|
23
|
+
- **Cancellation and timeouts:** preserve caller cancellation, distinguish attempt expiry from upstream failures, and enforce the derived 64,375 ms total retry deadline with post-read abort checks ([#20](https://github.com/cyanheads/nonprofit-explorer-mcp-server/issues/20)).
|
|
24
|
+
|
|
25
|
+
## Dependencies
|
|
26
|
+
|
|
27
|
+
- `@cyanheads/mcp-ts-core` ^0.13.14 → ^0.13.15.
|
|
28
|
+
- `zod` ^4.6.5 → ^4.6.7.
|
|
29
|
+
- `@types/node` ^26.6.4 → ^26.6.5.
|
|
30
|
+
- `tsc-alias` ^1.9.7 → ^1.9.8.
|
|
31
|
+
- `vitest` ^5.0.3 → ^5.0.5.
|
package/dist/index.js
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
import { createApp } from '@cyanheads/mcp-ts-core';
|
|
7
7
|
import { nonprofitGetFilings } from './mcp-server/tools/definitions/nonprofit-get-filings.tool.js';
|
|
8
8
|
import { nonprofitGetOrganization } from './mcp-server/tools/definitions/nonprofit-get-organization.tool.js';
|
|
9
|
-
import {
|
|
9
|
+
import { nonprofitSearchOrganizations } from './mcp-server/tools/definitions/nonprofit-search-organizations.tool.js';
|
|
10
10
|
import { initNonprofitExplorerService } from './services/nonprofit-explorer/nonprofit-explorer-service.js';
|
|
11
11
|
await createApp({
|
|
12
12
|
name: 'nonprofit-explorer-mcp-server',
|
|
13
13
|
title: 'nonprofit-explorer-mcp-server',
|
|
14
|
-
tools: [
|
|
14
|
+
tools: [nonprofitSearchOrganizations, nonprofitGetOrganization, nonprofitGetFilings],
|
|
15
15
|
resources: [],
|
|
16
16
|
prompts: [],
|
|
17
17
|
/**
|
|
@@ -32,10 +32,6 @@ await createApp({
|
|
|
32
32
|
setup(core) {
|
|
33
33
|
initNonprofitExplorerService(core.config, core.storage);
|
|
34
34
|
},
|
|
35
|
-
instructions: 'ProPublica Nonprofit Explorer — keyless read-only access to IRS Form 990 data on 1.8M+ tax-exempt organizations.\n'
|
|
36
|
-
'- Start with nonprofit_search to find an org by name and get its EIN\n' +
|
|
37
|
-
'- Use nonprofit_get_organization for the full profile and latest financial snapshot\n' +
|
|
38
|
-
'- Use nonprofit_get_filings for year-by-year 990 data, executive comp, and source PDF links\n' +
|
|
39
|
-
'- Data lags 1–2 years; always cite the fiscal year (tax_prd_yr) when presenting financial figures',
|
|
35
|
+
instructions: 'ProPublica Nonprofit Explorer — keyless read-only access to IRS Form 990 data on 1.8M+ tax-exempt organizations.\n- Start with nonprofit_search_organizations to find an org by name and get its EIN\n- Use nonprofit_get_organization for the full profile and latest financial snapshot\n- Use nonprofit_get_filings for year-by-year 990 data, executive comp, and source PDF links\n- Data lags 1–2 years; always cite the fiscal year (tax_prd_yr) when presenting financial figures',
|
|
40
36
|
});
|
|
41
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mEAAmE,CAAC;AAC7G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mEAAmE,CAAC;AAC7G,OAAO,EAAE,4BAA4B,EAAE,MAAM,uEAAuE,CAAC;AACrH,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAE3G,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,+BAA+B;IACrC,KAAK,EAAE,+BAA+B;IACtC,KAAK,EAAE,CAAC,4BAA4B,EAAE,wBAAwB,EAAE,mBAAmB,CAAC;IACpF,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX;;;;;;OAMG;IACH,UAAU,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE;IACxE;;;;;OAKG;IACH,WAAW,EAAE,WAAW;IACxB,KAAK,CAAC,IAAI;QACR,4BAA4B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IACD,YAAY,EACV,2dAA2d;CAC9d,CAAC,CAAC"}
|
|
@@ -27,6 +27,10 @@ export declare const nonprofitGetFilings: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
27
27
|
contributions_and_grants: z.ZodNullable<z.ZodNumber>;
|
|
28
28
|
program_service_revenue: z.ZodNullable<z.ZodNumber>;
|
|
29
29
|
investment_income: z.ZodNullable<z.ZodNumber>;
|
|
30
|
+
grants_paid: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
distributable_amount: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
fair_market_value_assets: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
net_investment_income: z.ZodNullable<z.ZodNumber>;
|
|
30
34
|
program_expense_ratio: z.ZodNullable<z.ZodObject<{
|
|
31
35
|
ratio: z.ZodNullable<z.ZodNumber>;
|
|
32
36
|
program_expenses: z.ZodNullable<z.ZodNumber>;
|
|
@@ -60,11 +64,25 @@ export declare const nonprofitGetFilings: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
60
64
|
data_source: z.ZodString;
|
|
61
65
|
propublica_url: z.ZodString;
|
|
62
66
|
}, z.core.$strip>, readonly [{
|
|
67
|
+
readonly reason: "timeout";
|
|
68
|
+
readonly code: JsonRpcErrorCode.Timeout;
|
|
69
|
+
readonly thrownBy: "service";
|
|
70
|
+
readonly when: "A ProPublica API attempt expires before its response body finishes";
|
|
71
|
+
readonly retryable: true;
|
|
72
|
+
readonly recovery: "Wait a moment and retry the request.";
|
|
73
|
+
}, {
|
|
74
|
+
readonly reason: "retry_deadline_exceeded";
|
|
75
|
+
readonly code: JsonRpcErrorCode.Timeout;
|
|
76
|
+
readonly thrownBy: "service";
|
|
77
|
+
readonly when: "The complete ProPublica API retry exchange exceeds its deadline";
|
|
78
|
+
readonly retryable: true;
|
|
79
|
+
readonly recovery: "Wait a moment and retry the request.";
|
|
80
|
+
}, {
|
|
63
81
|
readonly reason: "not_found";
|
|
64
82
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
65
83
|
readonly thrownBy: "service";
|
|
66
84
|
readonly when: "The EIN does not correspond to a known organization in the Nonprofit Explorer database";
|
|
67
|
-
readonly recovery: "Verify the EIN with
|
|
85
|
+
readonly recovery: "Verify the EIN with nonprofit_search_organizations. Use the integer EIN value (leading zeros stripped).";
|
|
68
86
|
}, {
|
|
69
87
|
readonly reason: "upstream_error";
|
|
70
88
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonprofit-get-filings.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nonprofit-get-filings.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA6DjE,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"nonprofit-get-filings.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nonprofit-get-filings.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA6DjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8c9B,CAAC"}
|
|
@@ -65,7 +65,7 @@ export const nonprofitGetFilings = tool('nonprofit_get_filings', {
|
|
|
65
65
|
.regex(/^\d{2}-?\d{7}$/)
|
|
66
66
|
.describe('EIN as string, with or without hyphen (e.g., "53-0196605" or "530196605").'),
|
|
67
67
|
])
|
|
68
|
-
.describe('Employer Identification Number. Use
|
|
68
|
+
.describe('Employer Identification Number. Use nonprofit_search_organizations to resolve an org name to its EIN.'),
|
|
69
69
|
}),
|
|
70
70
|
output: z.object({
|
|
71
71
|
ein: z.number().describe('Employer Identification Number as integer.'),
|
|
@@ -107,19 +107,35 @@ export const nonprofitGetFilings = tool('nonprofit_get_filings', {
|
|
|
107
107
|
net_assets: z
|
|
108
108
|
.number()
|
|
109
109
|
.nullable()
|
|
110
|
-
.describe('Net assets/fund balances (end of year) in USD. From totnetassetend. Null when not extracted.'),
|
|
110
|
+
.describe('Net assets/fund balances (end of year) in USD. From totnetassetend (990), totnetassetsend (990-EZ), or tfundnworth (990-PF). Null when not extracted.'),
|
|
111
111
|
contributions_and_grants: z
|
|
112
112
|
.number()
|
|
113
113
|
.nullable()
|
|
114
|
-
.describe('
|
|
114
|
+
.describe('Contributions and grants in USD: totcntrbgfts (990), totcntrbs (990-EZ), or grscontrgifts (990-PF). Null when not extracted.'),
|
|
115
115
|
program_service_revenue: z
|
|
116
116
|
.number()
|
|
117
117
|
.nullable()
|
|
118
|
-
.describe('Program service revenue (
|
|
118
|
+
.describe('Program service revenue in USD: totprgmrevnue (990) or prgmservrev (990-EZ). Not applicable for 990-PF.'),
|
|
119
119
|
investment_income: z
|
|
120
120
|
.number()
|
|
121
121
|
.nullable()
|
|
122
|
-
.describe('Investment income (
|
|
122
|
+
.describe('Investment income in USD: invstmntinc (990), othrinvstinc (990-EZ), or intrstrvnue plus dividndsamt (990-PF Part I column (a), lines 3–4: savings interest plus dividends and securities interest; excludes capital gains, rents, and net investment income). PF requires both components; null when not extracted.'),
|
|
123
|
+
grants_paid: z
|
|
124
|
+
.number()
|
|
125
|
+
.nullable()
|
|
126
|
+
.describe('990-PF contributions, gifts, and grants paid in USD, Part I line 25 column (a), contrpdpbks. Null for other forms or when not extracted.'),
|
|
127
|
+
distributable_amount: z
|
|
128
|
+
.number()
|
|
129
|
+
.nullable()
|
|
130
|
+
.describe('990-PF required distributable amount in USD, Part X line 7, distribamt. A payout requirement, not actual payments or a compliance measure. Null for other forms or when not extracted.'),
|
|
131
|
+
fair_market_value_assets: z
|
|
132
|
+
.number()
|
|
133
|
+
.nullable()
|
|
134
|
+
.describe('990-PF end-of-year fair-market-value assets in USD, header Item I, fairmrktvalamt. Null for other forms or when not extracted.'),
|
|
135
|
+
net_investment_income: z
|
|
136
|
+
.number()
|
|
137
|
+
.nullable()
|
|
138
|
+
.describe('990-PF net investment income in USD, Part I line 27b, netinvstinc. Null for other forms or when not extracted.'),
|
|
123
139
|
program_expense_ratio: z
|
|
124
140
|
.object({
|
|
125
141
|
ratio: z
|
|
@@ -198,12 +214,28 @@ export const nonprofitGetFilings = tool('nonprofit_get_filings', {
|
|
|
198
214
|
.describe('Present when the organization resolved but Nonprofit Explorer holds no filing of any kind for it — names the org and why the filing history is empty. An empty filings array without this notice means the org has filings that carry a PDF but no extracted data; read filings_pdf_only.'),
|
|
199
215
|
},
|
|
200
216
|
errors: [
|
|
217
|
+
{
|
|
218
|
+
reason: 'timeout',
|
|
219
|
+
code: JsonRpcErrorCode.Timeout,
|
|
220
|
+
thrownBy: 'service',
|
|
221
|
+
when: 'A ProPublica API attempt expires before its response body finishes',
|
|
222
|
+
retryable: true,
|
|
223
|
+
recovery: 'Wait a moment and retry the request.',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
reason: 'retry_deadline_exceeded',
|
|
227
|
+
code: JsonRpcErrorCode.Timeout,
|
|
228
|
+
thrownBy: 'service',
|
|
229
|
+
when: 'The complete ProPublica API retry exchange exceeds its deadline',
|
|
230
|
+
retryable: true,
|
|
231
|
+
recovery: 'Wait a moment and retry the request.',
|
|
232
|
+
},
|
|
201
233
|
{
|
|
202
234
|
reason: 'not_found',
|
|
203
235
|
code: JsonRpcErrorCode.NotFound,
|
|
204
236
|
thrownBy: 'service',
|
|
205
237
|
when: 'The EIN does not correspond to a known organization in the Nonprofit Explorer database',
|
|
206
|
-
recovery: 'Verify the EIN with
|
|
238
|
+
recovery: 'Verify the EIN with nonprofit_search_organizations. Use the integer EIN value (leading zeros stripped).',
|
|
207
239
|
},
|
|
208
240
|
{
|
|
209
241
|
reason: 'upstream_error',
|
|
@@ -218,7 +250,6 @@ export const nonprofitGetFilings = tool('nonprofit_get_filings', {
|
|
|
218
250
|
const ein = normalizeEin(input.ein);
|
|
219
251
|
ctx.log.info('Fetching nonprofit filings', { ein });
|
|
220
252
|
const svc = getNonprofitExplorerService();
|
|
221
|
-
// Service throws notFound (reason: 'not_found') or serviceUnavailable (reason: 'upstream_error').
|
|
222
253
|
const raw = await svc.getOrganization(ein, ctx);
|
|
223
254
|
// Service validates organization presence and throws notFound before returning — safe to assert.
|
|
224
255
|
// biome-ignore lint/style/noNonNullAssertion: guaranteed by service not-found checks
|
|
@@ -248,10 +279,23 @@ export const nonprofitGetFilings = tool('nonprofit_get_filings', {
|
|
|
248
279
|
total_expenses: f.totfuncexpns ?? null,
|
|
249
280
|
total_assets: f.totassetsend ?? null,
|
|
250
281
|
total_liabilities: f.totliabend ?? null,
|
|
251
|
-
net_assets: f.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
282
|
+
net_assets: (f.formtype === 2
|
|
283
|
+
? f.tfundnworth
|
|
284
|
+
: f.formtype === 1
|
|
285
|
+
? f.totnetassetsend
|
|
286
|
+
: f.totnetassetend) ?? null,
|
|
287
|
+
contributions_and_grants: (f.formtype === 2 ? f.grscontrgifts : f.formtype === 1 ? f.totcntrbs : f.totcntrbgfts) ??
|
|
288
|
+
null,
|
|
289
|
+
program_service_revenue: (f.formtype === 2 ? null : f.formtype === 1 ? f.prgmservrev : f.totprgmrevnue) ?? null,
|
|
290
|
+
investment_income: f.formtype === 2
|
|
291
|
+
? f.intrstrvnue != null && f.dividndsamt != null
|
|
292
|
+
? f.intrstrvnue + f.dividndsamt
|
|
293
|
+
: null
|
|
294
|
+
: ((f.formtype === 1 ? f.othrinvstinc : f.invstmntinc) ?? null),
|
|
295
|
+
grants_paid: f.formtype === 2 ? (f.contrpdpbks ?? null) : null,
|
|
296
|
+
distributable_amount: f.formtype === 2 ? (f.distribamt ?? null) : null,
|
|
297
|
+
fair_market_value_assets: f.formtype === 2 ? (f.fairmrktvalamt ?? null) : null,
|
|
298
|
+
net_investment_income: f.formtype === 2 ? (f.netinvstinc ?? null) : null,
|
|
255
299
|
/**
|
|
256
300
|
* Not derived. `totfuncexpns` is Form 990 Part IX column (A); the program-service
|
|
257
301
|
* total is column (B), which ProPublica does not return, and Part IX allocates
|
|
@@ -303,17 +347,25 @@ export const nonprofitGetFilings = tool('nonprofit_get_filings', {
|
|
|
303
347
|
lines.push(`**Assets (EoY):** ${money(f.total_assets)}`);
|
|
304
348
|
lines.push(`**Liabilities (EoY):** ${money(f.total_liabilities)}`);
|
|
305
349
|
lines.push(`**Net Assets (EoY):** ${money(f.net_assets)}`);
|
|
306
|
-
/**
|
|
307
|
-
|
|
308
|
-
* 990-PF at all. "Not applicable for 990-PF" and "not extracted" are different
|
|
309
|
-
* facts about the same null, so the form type picks the label.
|
|
310
|
-
*/
|
|
311
|
-
const breakdownAbsent = f.form_type === '990-PF' ? notApplicableFor(f.form_type) : NOT_EXTRACTED;
|
|
350
|
+
/** Program-service revenue has no corresponding 990-PF line item. */
|
|
351
|
+
const programRevenueAbsent = f.form_type === '990-PF' ? notApplicableFor(f.form_type) : NOT_EXTRACTED;
|
|
312
352
|
lines.push('');
|
|
313
353
|
lines.push('### Revenue Breakdown');
|
|
314
|
-
lines.push(`**Contributions & Grants:** ${money(f.contributions_and_grants
|
|
315
|
-
lines.push(`**Program Service Revenue:** ${money(f.program_service_revenue,
|
|
316
|
-
lines.push(`**Investment Income:** ${money(f.investment_income
|
|
354
|
+
lines.push(`**Contributions & Grants:** ${money(f.contributions_and_grants)}`);
|
|
355
|
+
lines.push(`**Program Service Revenue:** ${money(f.program_service_revenue, programRevenueAbsent)}`);
|
|
356
|
+
lines.push(`**Investment Income:** ${money(f.investment_income)}`);
|
|
357
|
+
if (f.form_type === '990-PF') {
|
|
358
|
+
lines.push('990-PF investment income is Part I column (a), lines 3–4: savings interest plus dividends and securities interest; excludes capital gains, rents, and net investment income. Both components must be extracted.');
|
|
359
|
+
}
|
|
360
|
+
const pfAbsent = f.form_type === '990-PF' ? NOT_EXTRACTED : notApplicableFor(f.form_type);
|
|
361
|
+
lines.push('');
|
|
362
|
+
lines.push('### 990-PF Foundation Financials');
|
|
363
|
+
lines.push(`**Grants Paid (Part I line 25 column (a)):** ${money(f.grants_paid, pfAbsent)}`);
|
|
364
|
+
lines.push(`**Distributable Amount (required, Part X line 7):** ${money(f.distributable_amount, pfAbsent)}`);
|
|
365
|
+
lines.push(`**Fair-Market-Value Assets (EoY, Item I):** ${money(f.fair_market_value_assets, pfAbsent)}`);
|
|
366
|
+
lines.push(`**Net Investment Income (Part I line 27b):** ${money(f.net_investment_income, pfAbsent)}`);
|
|
367
|
+
if (f.form_type === '990-PF')
|
|
368
|
+
lines.push('The distributable amount is a payout requirement, not actual payments or a compliance measure.');
|
|
317
369
|
const r = f.program_expense_ratio;
|
|
318
370
|
lines.push('');
|
|
319
371
|
lines.push('### Program Expense Ratio');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonprofit-get-filings.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/non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,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;YAC9D,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;gBACxC,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAC;gBACxE,4EAA4E;gBAC5E,qEAAqE;gBACrE,MAAM,SAAS,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/D,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,UAAU,GAAG,SAAS,KAAK,OAAO,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC;QAEtC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"nonprofit-get-filings.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nonprofit-get-filings.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL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IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -40,14 +40,29 @@ export declare const nonprofitGetOrganization: import("@cyanheads/mcp-ts-core").
|
|
|
40
40
|
pdf_url: z.ZodNullable<z.ZodString>;
|
|
41
41
|
}, z.core.$strip>>;
|
|
42
42
|
filing_count: z.ZodNumber;
|
|
43
|
+
filing_count_pdf_only: z.ZodNumber;
|
|
43
44
|
data_source: z.ZodString;
|
|
44
45
|
propublica_url: z.ZodString;
|
|
45
46
|
}, z.core.$strip>, readonly [{
|
|
47
|
+
readonly reason: "timeout";
|
|
48
|
+
readonly code: JsonRpcErrorCode.Timeout;
|
|
49
|
+
readonly thrownBy: "service";
|
|
50
|
+
readonly when: "A ProPublica API attempt expires before its response body finishes";
|
|
51
|
+
readonly retryable: true;
|
|
52
|
+
readonly recovery: "Wait a moment and retry the request.";
|
|
53
|
+
}, {
|
|
54
|
+
readonly reason: "retry_deadline_exceeded";
|
|
55
|
+
readonly code: JsonRpcErrorCode.Timeout;
|
|
56
|
+
readonly thrownBy: "service";
|
|
57
|
+
readonly when: "The complete ProPublica API retry exchange exceeds its deadline";
|
|
58
|
+
readonly retryable: true;
|
|
59
|
+
readonly recovery: "Wait a moment and retry the request.";
|
|
60
|
+
}, {
|
|
46
61
|
readonly reason: "not_found";
|
|
47
62
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
48
63
|
readonly thrownBy: "service";
|
|
49
64
|
readonly when: "The EIN does not correspond to a known organization in the Nonprofit Explorer database";
|
|
50
|
-
readonly recovery: "Verify the EIN with
|
|
65
|
+
readonly recovery: "Verify the EIN with nonprofit_search_organizations. EINs with leading zeros are stored without them — try the integer value.";
|
|
51
66
|
}, {
|
|
52
67
|
readonly reason: "upstream_error";
|
|
53
68
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nonprofit-get-organization.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nonprofit-get-organization.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA+EjE,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"nonprofit-get-organization.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/nonprofit-get-organization.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA+EjE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwTnC,CAAC"}
|
|
@@ -71,7 +71,7 @@ function decodeIrsCode(code, labels) {
|
|
|
71
71
|
}
|
|
72
72
|
export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
73
73
|
title: 'Get Nonprofit Organization',
|
|
74
|
-
description: 'Full profile for a single tax-exempt org by EIN: legal name, address, NTEE classification, 501(c) type, IRS ruling date, and a financial snapshot from the most recent Form 990 filing (revenue, expenses, assets, net assets, and the source PDF link). Also returns the IRS Business Master File standing — whether contributions are deductible, exemption status, and public-charity vs. private-foundation classification. Use
|
|
74
|
+
description: 'Full profile for a single tax-exempt org by EIN: legal name, address, NTEE classification, 501(c) type, IRS ruling date, and a financial snapshot from the most recent Form 990 filing (revenue, expenses, assets, net assets, and the source PDF link). Also returns the IRS Business Master File standing — whether contributions are deductible, exemption status, and public-charity vs. private-foundation classification. Use nonprofit_search_organizations first if you only have an org name — this tool requires an EIN. Data lags 1–2 years; the tax year is shown prominently. Data from ProPublica Nonprofit Explorer, sourced from IRS Form 990 filings.',
|
|
75
75
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
76
76
|
input: z.object({
|
|
77
77
|
ein: z
|
|
@@ -86,7 +86,7 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
86
86
|
.regex(/^\d{2}-?\d{7}$/)
|
|
87
87
|
.describe('EIN as string, with or without hyphen (e.g., "53-0196605" or "530196605").'),
|
|
88
88
|
])
|
|
89
|
-
.describe('Employer Identification Number. Accepts integer (530196605) or string with optional hyphen ("53-0196605"). Obtain from
|
|
89
|
+
.describe('Employer Identification Number. Accepts integer (530196605) or string with optional hyphen ("53-0196605"). Obtain from nonprofit_search_organizations results.'),
|
|
90
90
|
}),
|
|
91
91
|
output: z.object({
|
|
92
92
|
ein: z.number().describe('Employer Identification Number as integer.'),
|
|
@@ -168,7 +168,7 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
168
168
|
net_assets: z
|
|
169
169
|
.number()
|
|
170
170
|
.nullable()
|
|
171
|
-
.describe('Net assets/fund balances (end of year) in USD. From totnetassetend. Null when not extracted.'),
|
|
171
|
+
.describe('Net assets/fund balances (end of year) in USD. From totnetassetend (990), totnetassetsend (990-EZ), or tfundnworth (990-PF). Null when not extracted.'),
|
|
172
172
|
pdf_url: z
|
|
173
173
|
.string()
|
|
174
174
|
.nullable()
|
|
@@ -177,16 +177,35 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
177
177
|
.nullable()
|
|
178
178
|
.describe('Financial snapshot from the most recent Form 990. Null if no filings_with_data are available.'),
|
|
179
179
|
filing_count: z.number().describe('Total filings with extracted data on record.'),
|
|
180
|
+
filing_count_pdf_only: z
|
|
181
|
+
.number()
|
|
182
|
+
.describe('Total PDF-only filings without extracted financial data. Use nonprofit_get_filings for their PDF links.'),
|
|
180
183
|
data_source: z.string().describe('ProPublica + IRS attribution text.'),
|
|
181
184
|
propublica_url: z.string().describe('ProPublica Nonprofit Explorer URL for this org.'),
|
|
182
185
|
}),
|
|
183
186
|
errors: [
|
|
187
|
+
{
|
|
188
|
+
reason: 'timeout',
|
|
189
|
+
code: JsonRpcErrorCode.Timeout,
|
|
190
|
+
thrownBy: 'service',
|
|
191
|
+
when: 'A ProPublica API attempt expires before its response body finishes',
|
|
192
|
+
retryable: true,
|
|
193
|
+
recovery: 'Wait a moment and retry the request.',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
reason: 'retry_deadline_exceeded',
|
|
197
|
+
code: JsonRpcErrorCode.Timeout,
|
|
198
|
+
thrownBy: 'service',
|
|
199
|
+
when: 'The complete ProPublica API retry exchange exceeds its deadline',
|
|
200
|
+
retryable: true,
|
|
201
|
+
recovery: 'Wait a moment and retry the request.',
|
|
202
|
+
},
|
|
184
203
|
{
|
|
185
204
|
reason: 'not_found',
|
|
186
205
|
code: JsonRpcErrorCode.NotFound,
|
|
187
206
|
thrownBy: 'service',
|
|
188
207
|
when: 'The EIN does not correspond to a known organization in the Nonprofit Explorer database',
|
|
189
|
-
recovery: 'Verify the EIN with
|
|
208
|
+
recovery: 'Verify the EIN with nonprofit_search_organizations. EINs with leading zeros are stored without them — try the integer value.',
|
|
190
209
|
},
|
|
191
210
|
{
|
|
192
211
|
reason: 'upstream_error',
|
|
@@ -201,8 +220,6 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
201
220
|
const ein = normalizeEin(input.ein);
|
|
202
221
|
ctx.log.info('Fetching nonprofit organization', { ein });
|
|
203
222
|
const svc = getNonprofitExplorerService();
|
|
204
|
-
// Service throws notFound (with reason: 'not_found') or serviceUnavailable (reason: 'upstream_error')
|
|
205
|
-
// propagated unchanged by the framework auto-classifier.
|
|
206
223
|
const raw = await svc.getOrganization(ein, ctx);
|
|
207
224
|
// Service validates organization presence and throws notFound before returning — safe to assert.
|
|
208
225
|
// biome-ignore lint/style/noNonNullAssertion: guaranteed by service not-found checks
|
|
@@ -219,7 +236,11 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
219
236
|
total_expenses: latest.totfuncexpns ?? null,
|
|
220
237
|
total_assets: latest.totassetsend ?? null,
|
|
221
238
|
total_liabilities: latest.totliabend ?? null,
|
|
222
|
-
net_assets: latest.
|
|
239
|
+
net_assets: (latest.formtype === 2
|
|
240
|
+
? latest.tfundnworth
|
|
241
|
+
: latest.formtype === 1
|
|
242
|
+
? latest.totnetassetsend
|
|
243
|
+
: latest.totnetassetend) ?? null,
|
|
223
244
|
pdf_url: latest.pdf_url ?? null,
|
|
224
245
|
}
|
|
225
246
|
: null;
|
|
@@ -246,6 +267,7 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
246
267
|
bmf_tax_period: org.tax_period ?? null,
|
|
247
268
|
latest_filing: latestFiling,
|
|
248
269
|
filing_count: filings.length,
|
|
270
|
+
filing_count_pdf_only: raw.filings_without_data?.length ?? 0,
|
|
249
271
|
data_source: raw.data_source ?? 'ProPublica Nonprofit Explorer, IRS Form 990 data.',
|
|
250
272
|
propublica_url: `https://projects.propublica.org/nonprofits/organizations/${einNum}`,
|
|
251
273
|
};
|
|
@@ -273,7 +295,8 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
273
295
|
lines.push(`**Address:** ${result.address ?? NOT_ON_RECORD}`);
|
|
274
296
|
lines.push(`**City:** ${result.city ?? NOT_ON_RECORD} | **State:** ${result.state ?? NOT_ON_RECORD} | ` +
|
|
275
297
|
`**ZIP:** ${result.zipcode ?? NOT_ON_RECORD}`);
|
|
276
|
-
lines.push(`**Filings
|
|
298
|
+
lines.push(`**Filings with extracted data:** ${result.filing_count}`);
|
|
299
|
+
lines.push(`**PDF-only filings:** ${result.filing_count_pdf_only}`);
|
|
277
300
|
lines.push('');
|
|
278
301
|
lines.push(`**Profile:** ${result.propublica_url}`);
|
|
279
302
|
if (result.latest_filing) {
|
|
@@ -288,6 +311,10 @@ export const nonprofitGetOrganization = tool('nonprofit_get_organization', {
|
|
|
288
311
|
lines.push(`**Net Assets:** ${money(f.net_assets)}`);
|
|
289
312
|
lines.push(`**Source 990 PDF:** ${f.pdf_url ?? 'Not yet available for this period'}`);
|
|
290
313
|
}
|
|
314
|
+
else if (result.filing_count_pdf_only > 0) {
|
|
315
|
+
lines.push('');
|
|
316
|
+
lines.push('*Only PDF-only filings are available; no extracted financial snapshot. Use nonprofit_get_filings for PDF links.*');
|
|
317
|
+
}
|
|
291
318
|
else {
|
|
292
319
|
lines.push('');
|
|
293
320
|
lines.push('*No Form 990 data on file. Org may file Form 990N (under $50K revenue).*');
|