@cyanheads/openfec-mcp-server 0.4.2 → 0.4.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 (61) hide show
  1. package/README.md +2 -2
  2. package/dist/mcp-server/prompts/definitions/campaign-analysis.prompt.d.ts.map +1 -1
  3. package/dist/mcp-server/prompts/definitions/campaign-analysis.prompt.js +17 -9
  4. package/dist/mcp-server/prompts/definitions/campaign-analysis.prompt.js.map +1 -1
  5. package/dist/mcp-server/prompts/definitions/money-trail.prompt.d.ts.map +1 -1
  6. package/dist/mcp-server/prompts/definitions/money-trail.prompt.js +10 -6
  7. package/dist/mcp-server/prompts/definitions/money-trail.prompt.js.map +1 -1
  8. package/dist/mcp-server/resources/definitions/candidate.resource.d.ts.map +1 -1
  9. package/dist/mcp-server/resources/definitions/candidate.resource.js +7 -3
  10. package/dist/mcp-server/resources/definitions/candidate.resource.js.map +1 -1
  11. package/dist/mcp-server/resources/definitions/committee.resource.d.ts.map +1 -1
  12. package/dist/mcp-server/resources/definitions/committee.resource.js +10 -3
  13. package/dist/mcp-server/resources/definitions/committee.resource.js.map +1 -1
  14. package/dist/mcp-server/resources/definitions/election.resource.d.ts +13 -6
  15. package/dist/mcp-server/resources/definitions/election.resource.d.ts.map +1 -1
  16. package/dist/mcp-server/resources/definitions/election.resource.js +10 -9
  17. package/dist/mcp-server/resources/definitions/election.resource.js.map +1 -1
  18. package/dist/mcp-server/resources/definitions/index.d.ts +17 -1
  19. package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/index.d.ts +34 -15
  21. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/lookup-calendar.tool.d.ts +21 -2
  23. package/dist/mcp-server/tools/definitions/lookup-calendar.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/lookup-calendar.tool.js +26 -14
  25. package/dist/mcp-server/tools/definitions/lookup-calendar.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/lookup-elections.tool.d.ts +3 -3
  27. package/dist/mcp-server/tools/definitions/lookup-elections.tool.d.ts.map +1 -1
  28. package/dist/mcp-server/tools/definitions/lookup-elections.tool.js +9 -17
  29. package/dist/mcp-server/tools/definitions/lookup-elections.tool.js.map +1 -1
  30. package/dist/mcp-server/tools/definitions/search-candidates.tool.d.ts +3 -3
  31. package/dist/mcp-server/tools/definitions/search-candidates.tool.d.ts.map +1 -1
  32. package/dist/mcp-server/tools/definitions/search-candidates.tool.js +6 -6
  33. package/dist/mcp-server/tools/definitions/search-candidates.tool.js.map +1 -1
  34. package/dist/mcp-server/tools/definitions/search-committees.tool.d.ts +2 -2
  35. package/dist/mcp-server/tools/definitions/search-committees.tool.js +5 -5
  36. package/dist/mcp-server/tools/definitions/search-committees.tool.js.map +1 -1
  37. package/dist/mcp-server/tools/definitions/search-contributions.tool.d.ts.map +1 -1
  38. package/dist/mcp-server/tools/definitions/search-contributions.tool.js +7 -13
  39. package/dist/mcp-server/tools/definitions/search-contributions.tool.js.map +1 -1
  40. package/dist/mcp-server/tools/definitions/search-disbursements.tool.d.ts.map +1 -1
  41. package/dist/mcp-server/tools/definitions/search-disbursements.tool.js +8 -14
  42. package/dist/mcp-server/tools/definitions/search-disbursements.tool.js.map +1 -1
  43. package/dist/mcp-server/tools/definitions/search-expenditures.tool.d.ts +1 -1
  44. package/dist/mcp-server/tools/definitions/search-expenditures.tool.d.ts.map +1 -1
  45. package/dist/mcp-server/tools/definitions/search-expenditures.tool.js +5 -13
  46. package/dist/mcp-server/tools/definitions/search-expenditures.tool.js.map +1 -1
  47. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +4 -4
  48. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
  49. package/dist/mcp-server/tools/definitions/search-filings.tool.js +18 -13
  50. package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
  51. package/dist/mcp-server/tools/definitions/search-legal.tool.js +2 -2
  52. package/dist/mcp-server/tools/definitions/search-legal.tool.js.map +1 -1
  53. package/dist/mcp-server/tools/definitions/utils/format-helpers.d.ts.map +1 -1
  54. package/dist/mcp-server/tools/definitions/utils/format-helpers.js +4 -2
  55. package/dist/mcp-server/tools/definitions/utils/format-helpers.js.map +1 -1
  56. package/dist/services/openfec/openfec-service.d.ts +2 -0
  57. package/dist/services/openfec/openfec-service.d.ts.map +1 -1
  58. package/dist/services/openfec/openfec-service.js +6 -0
  59. package/dist/services/openfec/openfec-service.js.map +1 -1
  60. package/package.json +3 -2
  61. package/server.json +3 -3
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <div align="center">
8
8
 
9
- [![npm](https://img.shields.io/npm/v/@cyanheads/openfec-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openfec-mcp-server) [![Version](https://img.shields.io/badge/Version-0.4.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-259?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/)
9
+ [![npm](https://img.shields.io/npm/v/@cyanheads/openfec-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/openfec-mcp-server) [![Version](https://img.shields.io/badge/Version-0.4.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![Framework](https://img.shields.io/badge/Built%20on-@cyanheads/mcp--ts--core-259?style=flat-square)](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/)
10
10
 
11
11
  [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-^1.3.0-f9f1e1.svg?style=flat-square)](https://bun.sh/)
12
12
 
@@ -121,7 +121,7 @@ Look up federal election races.
121
121
 
122
122
  - **search**: Candidates in a race with financial totals
123
123
  - **summary**: Aggregate race financial summary
124
- - Office types: president, senate, house
124
+ - Office types: H (House), S (Senate), P (President)
125
125
  - ZIP code lookup to find races covering a location
126
126
  - Full election period expansion (4yr president, 6yr senate, 2yr house)
127
127
 
@@ -1 +1 @@
1
- {"version":3,"file":"campaign-analysis.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/campaign-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,sBAAsB;;;;kBAsEjC,CAAC"}
1
+ {"version":3,"file":"campaign-analysis.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/campaign-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,sBAAsB;;;;kBA8EjC,CAAC"}
@@ -7,7 +7,8 @@
7
7
  import { prompt, z } from '@cyanheads/mcp-ts-core';
8
8
  export const campaignAnalysisPrompt = prompt('openfec_campaign_analysis', {
9
9
  description: `Structured analysis of a candidate's financial position — fundraising trajectory, burn rate, cash reserves, donor composition, and opponent comparison.`,
10
- args: z.object({
10
+ args: z
11
+ .object({
11
12
  candidate_name: z
12
13
  .string()
13
14
  .optional()
@@ -20,6 +21,10 @@ export const campaignAnalysisPrompt = prompt('openfec_campaign_analysis', {
20
21
  .string()
21
22
  .optional()
22
23
  .describe('Election cycle year (e.g., 2024). Defaults to current cycle.'),
24
+ })
25
+ .refine((args) => Boolean(args.candidate_id || args.candidate_name), {
26
+ message: 'Provide candidate_id or candidate_name to identify the candidate to analyze.',
27
+ path: ['candidate_id'],
23
28
  }),
24
29
  generate: (args) => {
25
30
  const target = args.candidate_id
@@ -40,29 +45,32 @@ Use openfec_search_candidates with include_totals=true to get:
40
45
  - Total receipts, disbursements, cash on hand, debt
41
46
  - Coverage period dates
42
47
 
43
- ## 2. Fundraising Analysis
44
- Use openfec_search_contributions with the candidate's principal committee:
48
+ ## 2. Find the Principal Committee
49
+ Use openfec_search_committees with the candidate_id to identify the principal campaign committee. Use that committee_id for the contribution and disbursement queries in steps 3 and 4.
50
+
51
+ ## 3. Fundraising Analysis
52
+ Use openfec_search_contributions with the principal committee_id:
45
53
  - **Size breakdown** (mode: by_size): What share comes from small vs. large donors?
46
54
  - **Geographic reach** (mode: by_state): Where is financial support concentrated?
47
55
  - **Industry patterns** (mode: by_employer): Which employers/industries are top sources?
48
56
 
49
- ## 3. Burn Rate & Spending
50
- Use openfec_search_disbursements with the principal committee:
57
+ ## 4. Burn Rate & Spending
58
+ Use openfec_search_disbursements with the principal committee_id:
51
59
  - **Purpose breakdown** (mode: by_purpose): Media buys, consulting, payroll, fundraising, travel
52
60
  - **Top recipients** (mode: by_recipient): Where is the money going?
53
61
  - Calculate burn rate: disbursements / receipts
54
62
 
55
- ## 4. Competitive Position
63
+ ## 5. Competitive Position
56
64
  Use openfec_lookup_elections to find all candidates in the race:
57
65
  - Compare total raised, cash on hand, and burn rates
58
66
  - Identify financial advantages and gaps
59
67
 
60
- ## 5. Outside Money Context
61
- Use openfec_search_expenditures with candidate_id:
68
+ ## 6. Outside Money Context
69
+ Use openfec_search_expenditures with the candidate_id:
62
70
  - Total independent expenditure support vs. opposition
63
71
  - Key outside groups involved
64
72
 
65
- ## 6. Assessment
73
+ ## 7. Assessment
66
74
  Synthesize into a financial health assessment:
67
75
  - **Fundraising trajectory**: Growing, flat, or declining?
68
76
  - **Donor base health**: Broad grassroots vs. maxed-out large donors?
@@ -1 +1 @@
1
- {"version":3,"file":"campaign-analysis.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/campaign-analysis.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,2BAA2B,EAAE;IACxE,WAAW,EAAE,yJAAyJ;IACtK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qEAAqE,CAAC;QAClF,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,8DAA8D,CAAC;KAC5E,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY;YAC9B,CAAC,CAAC,gBAAgB,IAAI,CAAC,YAAY,EAAE;YACrC,CAAC,CAAC,IAAI,CAAC,cAAc;gBACnB,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,GAAG;gBAC5B,CAAC,CAAC,yBAAyB,CAAC;QAChC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnE,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,qDAAqD,MAAM,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAoCZ;iBAClE;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"campaign-analysis.prompt.js","s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,IAAI,EAAE,qDAAqD,MAAM,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAuCZ;iBAClE;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"money-trail.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/money-trail.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,gBAAgB;;;;kBAoE3B,CAAC"}
1
+ {"version":3,"file":"money-trail.prompt.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/money-trail.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAU,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,eAAO,MAAM,gBAAgB;;;;kBAwE3B,CAAC"}
@@ -6,8 +6,9 @@
6
6
  */
7
7
  import { prompt, z } from '@cyanheads/mcp-ts-core';
8
8
  export const moneyTrailPrompt = prompt('openfec_money_trail', {
9
- description: `Framework for tracing the flow of money around a candidate or race — direct fundraising, PAC support, independent expenditures, and party spending. Guides the agent through a multi-tool investigation.`,
10
- args: z.object({
9
+ description: `Multi-step framework for tracing the flow of money around a candidate or race — direct fundraising, PAC support, independent expenditures, and party spending.`,
10
+ args: z
11
+ .object({
11
12
  candidate_name: z
12
13
  .string()
13
14
  .optional()
@@ -20,6 +21,10 @@ export const moneyTrailPrompt = prompt('openfec_money_trail', {
20
21
  .string()
21
22
  .optional()
22
23
  .describe('Election cycle year (e.g., 2024). Defaults to current cycle.'),
24
+ })
25
+ .refine((args) => Boolean(args.candidate_id || args.candidate_name), {
26
+ message: 'Provide candidate_id or candidate_name to identify the candidate to investigate.',
27
+ path: ['candidate_id'],
23
28
  }),
24
29
  generate: (args) => {
25
30
  const target = args.candidate_id
@@ -45,11 +50,10 @@ Use openfec_search_committees with the candidate_id to find:
45
50
  - Joint fundraising committees
46
51
 
47
52
  ## Step 3: Follow direct fundraising
48
- For the principal campaign committee, use openfec_search_contributions to examine:
49
- - Overall totals (include_totals from step 1)
50
- - Contribution breakdown by size (mode: by_size)
53
+ Carry forward the receipt totals already retrieved in step 1. Use openfec_search_contributions with the principal campaign committee_id to break down where the money came from:
54
+ - Contribution size distribution (mode: by_size)
51
55
  - Top donor states (mode: by_state)
52
- - Top employer/occupation patterns (mode: by_employer, by_occupation)
56
+ - Top employer and occupation patterns (mode: by_employer, by_occupation)
53
57
 
54
58
  ## Step 4: Track outside money
55
59
  Use openfec_search_expenditures with the candidate_id to find:
@@ -1 +1 @@
1
- {"version":3,"file":"money-trail.prompt.js","sourceRoot":"","sources":["../../../../src/mcp-server/prompts/definitions/money-trail.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,EAAE;IAC5D,WAAW,EAAE,0MAA0M;IACvN,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,8DAA8D,CAAC;QAC3E,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,qEAAqE,CAAC;QAClF,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,8DAA8D,CAAC;KAC5E,CAAC;IACF,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY;YAC9B,CAAC,CAAC,gBAAgB,IAAI,CAAC,YAAY,EAAE;YACrC,CAAC,CAAC,IAAI,CAAC,cAAc;gBACnB,CAAC,CAAC,IAAI,IAA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CAAC,cAAc,CAAC,EAAE;QACnE,OAAO,EAAE,kFAAkF;QAC3F,IAAI,EAAE,CAAC,cAAc,CAAC;KACvB,CAAC;IACJ,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY;YAC9B,CAAC,CAAC,gBAAgB,IAAI,CAAC,YAAY,EAAE;YACrC,CAAC,CAAC,IAAI,CAAC,cAAc;gBACnB,CAAC,CAAC,IAAI,IAAI,CAAC,cAAc,GAAG;gBAC5B,CAAC,CAAC,yBAAyB,CAAC;QAChC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAEnE,OAAO;YACL;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,kCAAkC,MAAM,GAAG,SAAS;;;EAGlE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,IAAI,CAAC,YAAY,4DAA4D,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,cAAc,0GAA0G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CA8BzN;iBACrC;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"candidate.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/candidate.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;GAsC5B,CAAC"}
1
+ {"version":3,"file":"candidate.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/candidate.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;GA2C5B,CAAC"}
@@ -25,7 +25,11 @@ export const candidateResource = resource('openfec://candidate/{candidate_id}',
25
25
  async handler(params, ctx) {
26
26
  validateCandidateId(params.candidate_id);
27
27
  const fec = getOpenFecService();
28
- const candidateResult = await fec.getCandidate(params.candidate_id, ctx);
28
+ const [candidateResult, totalsResult, committeesResult] = await Promise.all([
29
+ fec.getCandidate(params.candidate_id, ctx),
30
+ fec.getCandidateTotals({ candidate_id: params.candidate_id }, ctx),
31
+ fec.getCandidateCommittees(params.candidate_id, { designation: 'P' }, ctx),
32
+ ]);
29
33
  const candidate = candidateResult.results[0];
30
34
  if (!candidate) {
31
35
  throw ctx.fail('candidate_not_found', `Candidate ${params.candidate_id} not found.`, {
@@ -33,10 +37,10 @@ export const candidateResource = resource('openfec://candidate/{candidate_id}',
33
37
  ...ctx.recoveryFor('candidate_not_found'),
34
38
  });
35
39
  }
36
- const totalsResult = await fec.getCandidateTotals({ candidate_id: params.candidate_id }, ctx);
37
40
  const totals = totalsResult.results[0];
41
+ const principal_committees = committeesResult.results;
38
42
  ctx.log.info('Candidate resource fetched', { candidate_id: params.candidate_id });
39
- return { ...candidate, ...(totals ?? {}) };
43
+ return { ...candidate, ...(totals ?? {}), principal_committees };
40
44
  },
41
45
  });
42
46
  //# sourceMappingURL=candidate.resource.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"candidate.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/candidate.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAA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AAC;QAEvC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"candidate.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/candidate.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,oCAAoC,EAAE;IAC9E,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,uJAAuJ;IACzJ,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;KAC9F,CAAC;IAEF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,qBAAqB;YAC7B,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,mDAAmD;YACzD,QAAQ,EACN,iHAAiH;SACpH;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAEzC,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;QAChC,MAAM,CAAC,eAAe,EAAE,YAAY,EAAE,gBAAgB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC1E,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;YAC1C,GAAG,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,EAAE,GAAG,CAAC;YAClE,GAAG,CAAC,sBAAsB,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC;SAC3E,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,GAAG,CAAC,IAAI,CAAC,qBAAqB,EAAE,aAAa,MAAM,CAAC,YAAY,aAAa,EAAE;gBACnF,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,GAAG,GAAG,CAAC,WAAW,CAAC,qBAAqB,CAAC;aAC1C,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,OAAO,CAAC;QAEtD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACnE,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"committee.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/committee.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;GAmC5B,CAAC"}
1
+ {"version":3,"file":"committee.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/committee.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,iBAAiB;;;;;;;GA4C5B,CAAC"}
@@ -25,16 +25,23 @@ export const committeeResource = resource('openfec://committee/{committee_id}',
25
25
  async handler(params, ctx) {
26
26
  validateCommitteeId(params.committee_id);
27
27
  const fec = getOpenFecService();
28
- const result = await fec.getCommittee(params.committee_id, ctx);
29
- const committee = result.results[0];
28
+ // Totals 404 for committees that don't file Form 3/3X/3P — treat any
29
+ // totals failure as "no totals" while letting the base fetch surface
30
+ // the committee_not_found contract.
31
+ const [committeeResult, totalsResult] = await Promise.all([
32
+ fec.getCommittee(params.committee_id, ctx),
33
+ fec.getCommitteeTotals(params.committee_id, { per_page: 1 }, ctx).catch(() => null),
34
+ ]);
35
+ const committee = committeeResult.results[0];
30
36
  if (!committee) {
31
37
  throw ctx.fail('committee_not_found', `Committee ${params.committee_id} not found.`, {
32
38
  committee_id: params.committee_id,
33
39
  ...ctx.recoveryFor('committee_not_found'),
34
40
  });
35
41
  }
42
+ const totals = totalsResult?.results[0];
36
43
  ctx.log.info('Committee resource fetched', { committee_id: params.committee_id });
37
- return committee;
44
+ return { ...committee, ...(totals ?? {}) };
38
45
  },
39
46
  });
40
47
  //# sourceMappingURL=committee.resource.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"committee.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/committee.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,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{"version":3,"file":"committee.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/committee.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,oCAAoC,EAAE;IAC9E,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EACT,qJAAqJ;IACvJ,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;KACxE,CAAC;IAEF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,qBAAqB;YAC7B,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,mDAAmD;YACzD,QAAQ,EACN,6GAA6G;SAChH;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAEzC,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;QAChC,qEAAqE;QACrE,qEAAqE;QACrE,oCAAoC;QACpC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACxD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;YAC1C,GAAG,CAAC,kBAAkB,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;SACpF,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7C,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,GAAG,CAAC,IAAI,CAAC,qBAAqB,EAAE,aAAa,MAAM,CAAC,YAAY,aAAa,EAAE;gBACnF,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,GAAG,GAAG,CAAC,WAAW,CAAC,qBAAqB,CAAC;aAC1C,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QAExC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC"}
@@ -4,21 +4,28 @@
4
4
  * @module src/mcp-server/resources/definitions/election.resource
5
5
  */
6
6
  import { z } from '@cyanheads/mcp-ts-core';
7
- /** Presidential and at-large races: openfec://election/2024/president */
7
+ /** Presidential races: openfec://election/2024/P */
8
8
  export declare const electionResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
9
9
  cycle: z.ZodString;
10
- office: z.ZodString;
10
+ office: z.ZodEnum<{
11
+ P: "P";
12
+ }>;
11
13
  }, z.core.$strip>, undefined, undefined>;
12
- /** Senate races: openfec://election/2024/senate/AZ */
14
+ /** Senate or at-large house races: openfec://election/2024/S/AZ */
13
15
  export declare const electionStateResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
14
16
  cycle: z.ZodString;
15
- office: z.ZodString;
17
+ office: z.ZodEnum<{
18
+ H: "H";
19
+ S: "S";
20
+ }>;
16
21
  state: z.ZodString;
17
22
  }, z.core.$strip>, undefined, undefined>;
18
- /** House races: openfec://election/2024/house/CA/12 */
23
+ /** House district races: openfec://election/2024/H/CA/12 */
19
24
  export declare const electionDistrictResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
20
25
  cycle: z.ZodString;
21
- office: z.ZodString;
26
+ office: z.ZodEnum<{
27
+ H: "H";
28
+ }>;
22
29
  state: z.ZodString;
23
30
  district: z.ZodString;
24
31
  }, z.core.$strip>, undefined, undefined>;
@@ -1 +1 @@
1
- {"version":3,"file":"election.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/election.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAmCrD,yEAAyE;AACzE,eAAO,MAAM,gBAAgB;;;wCAU3B,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,qBAAqB;;;;wCAUhC,CAAC;AAEH,uDAAuD;AACvD,eAAO,MAAM,wBAAwB;;;;;wCAcpC,CAAC"}
1
+ {"version":3,"file":"election.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/election.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAsCrD,oDAAoD;AACpD,eAAO,MAAM,gBAAgB;;;;;wCAU3B,CAAC;AAEH,mEAAmE;AACnE,eAAO,MAAM,qBAAqB;;;;;;;wCAWhC,CAAC;AAEH,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB;;;;;;;wCAcpC,CAAC"}
@@ -5,12 +5,13 @@
5
5
  */
6
6
  import { resource, z } from '@cyanheads/mcp-ts-core';
7
7
  import { getOpenFecService } from '../../../services/openfec/openfec-service.js';
8
+ const OFFICE_API_FORM = { H: 'house', S: 'senate', P: 'president' };
8
9
  /** Shared handler logic for all election resource URI variants. */
9
10
  async function fetchElection(params, ctx) {
10
11
  const fec = getOpenFecService();
11
12
  const apiParams = {
12
13
  cycle: params.cycle,
13
- office: params.office,
14
+ office: OFFICE_API_FORM[params.office],
14
15
  election_full: true,
15
16
  };
16
17
  if (params.state)
@@ -32,37 +33,37 @@ async function fetchElection(params, ctx) {
32
33
  candidates: result.results,
33
34
  };
34
35
  }
35
- /** Presidential and at-large races: openfec://election/2024/president */
36
+ /** Presidential races: openfec://election/2024/P */
36
37
  export const electionResource = resource('openfec://election/{cycle}/{office}', {
37
38
  name: 'FEC Election Race',
38
- description: 'Fetch an election race with candidate financial totals. For senate races use openfec://election/{cycle}/senate/{state}. For house races use openfec://election/{cycle}/house/{state}/{district}.',
39
+ description: 'Fetch a presidential election race with candidate financial totals. For senate races use openfec://election/{cycle}/S/{state}. For house races use openfec://election/{cycle}/H/{state}/{district}.',
39
40
  mimeType: 'application/json',
40
41
  params: z.object({
41
42
  cycle: z.string().describe('Election cycle year (e.g., 2024)'),
42
- office: z.string().describe('Office: president, senate, or house'),
43
+ office: z.enum(['P']).describe('Office code: P=President.'),
43
44
  }),
44
45
  handler: (params, ctx) => fetchElection(params, ctx),
45
46
  });
46
- /** Senate races: openfec://election/2024/senate/AZ */
47
+ /** Senate or at-large house races: openfec://election/2024/S/AZ */
47
48
  export const electionStateResource = resource('openfec://election/{cycle}/{office}/{state}', {
48
49
  name: 'FEC Election Race (State)',
49
- description: 'Fetch a senate or at-large election race with candidate financial totals.',
50
+ description: 'Fetch a senate race, or a house at-large race in a single-district state, with candidate financial totals.',
50
51
  mimeType: 'application/json',
51
52
  params: z.object({
52
53
  cycle: z.string().describe('Election cycle year (e.g., 2024)'),
53
- office: z.string().describe('Office: senate (or president)'),
54
+ office: z.enum(['S', 'H']).describe('Office code: S=Senate, H=House (at-large).'),
54
55
  state: z.string().describe('Two-letter US state code (e.g., AZ)'),
55
56
  }),
56
57
  handler: (params, ctx) => fetchElection(params, ctx),
57
58
  });
58
- /** House races: openfec://election/2024/house/CA/12 */
59
+ /** House district races: openfec://election/2024/H/CA/12 */
59
60
  export const electionDistrictResource = resource('openfec://election/{cycle}/{office}/{state}/{district}', {
60
61
  name: 'FEC Election Race (District)',
61
62
  description: 'Fetch a house election race with candidate financial totals.',
62
63
  mimeType: 'application/json',
63
64
  params: z.object({
64
65
  cycle: z.string().describe('Election cycle year (e.g., 2024)'),
65
- office: z.string().describe('Office: house'),
66
+ office: z.enum(['H']).describe('Office code: H=House.'),
66
67
  state: z.string().describe('Two-letter US state code (e.g., CA)'),
67
68
  district: z.string().describe('Two-digit district number (e.g., 12)'),
68
69
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"election.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/election.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E,mEAAmE;AACnE,KAAK,UAAU,aAAa,CAC1B,MAA4E,EAC5E,GAA6D;IAE7D,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;IAChC,MAAM,SAAS,GAAc;QAC3B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,aAAa,EAAE,IAAI;KACpB,CAAC;IACF,IAAI,MAAM,CAAC,KAAK;QAAE,SAAS,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IACjD,IAAI,MAAM,CAAC,QAAQ;QAAE,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IAE1D,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAEzD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA2B,EAAE;QACxC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,E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E,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC;CACrD,CAAC,CAAC;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAC9C,wDAAwD,EACxD;IACE,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;QACjE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;KACtE,CAAC;IACF,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC;CACrD,CACF,CAAC"}
1
+ {"version":3,"file":"election.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/election.resource.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAG1E,MAAM,eAAe,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,WAAW,EAAW,CAAC;AAG7E,mEAAmE;AACnE,KAAK,UAAU,aAAa,CAC1B,MAAgF,EAChF,GAA6D;IAE7D,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;IAChC,MAAM,SAAS,GAAc;QAC3B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,MAAM,EAAE,eAAe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,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC;CACrD,CACF,CAAC"}
@@ -21,6 +21,22 @@ export declare const allResourceDefinitions: (import("@cyanheads/mcp-ts-core").R
21
21
  readonly recovery: "Verify the committee_id format (C + digits) or look up the committee by name via openfec_search_committees.";
22
22
  }]> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
23
23
  cycle: import("zod").ZodString;
24
- office: import("zod").ZodString;
24
+ office: import("zod").ZodEnum<{
25
+ P: "P";
26
+ }>;
27
+ }, import("zod/v4/core").$strip>, undefined, undefined> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
28
+ cycle: import("zod").ZodString;
29
+ office: import("zod").ZodEnum<{
30
+ H: "H";
31
+ S: "S";
32
+ }>;
33
+ state: import("zod").ZodString;
34
+ }, import("zod/v4/core").$strip>, undefined, undefined> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
35
+ cycle: import("zod").ZodString;
36
+ office: import("zod").ZodEnum<{
37
+ H: "H";
38
+ }>;
39
+ state: import("zod").ZodString;
40
+ district: import("zod").ZodString;
25
41
  }, import("zod/v4/core").$strip>, undefined, undefined>)[];
26
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAUhC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;0DAMlC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAUhC,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAMlC,CAAC"}
@@ -19,13 +19,32 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
19
19
  }>>;
20
20
  state: import("zod").ZodOptional<import("zod").ZodString>;
21
21
  office: import("zod").ZodOptional<import("zod").ZodEnum<{
22
+ P: "P";
22
23
  H: "H";
23
24
  S: "S";
24
- P: "P";
25
25
  }>>;
26
26
  report_type: import("zod").ZodOptional<import("zod").ZodString>;
27
27
  report_year: import("zod").ZodOptional<import("zod").ZodNumber>;
28
- category: import("zod").ZodOptional<import("zod").ZodString>;
28
+ category: import("zod").ZodOptional<import("zod").ZodEnum<{
29
+ 20: "20";
30
+ 21: "21";
31
+ 22: "22";
32
+ 23: "23";
33
+ 24: "24";
34
+ 25: "25";
35
+ 26: "26";
36
+ 27: "27";
37
+ 28: "28";
38
+ 29: "29";
39
+ 32: "32";
40
+ 33: "33";
41
+ 34: "34";
42
+ 36: "36";
43
+ 37: "37";
44
+ 38: "38";
45
+ 39: "39";
46
+ 40: "40";
47
+ }>>;
29
48
  election_year: import("zod").ZodOptional<import("zod").ZodNumber>;
30
49
  description: import("zod").ZodOptional<import("zod").ZodString>;
31
50
  min_date: import("zod").ZodOptional<import("zod").ZodString>;
@@ -47,9 +66,9 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
47
66
  search: "search";
48
67
  }>>;
49
68
  office: import("zod").ZodEnum<{
50
- president: "president";
51
- senate: "senate";
52
- house: "house";
69
+ P: "P";
70
+ H: "H";
71
+ S: "S";
53
72
  }>;
54
73
  cycle: import("zod").ZodNumber;
55
74
  state: import("zod").ZodOptional<import("zod").ZodString>;
@@ -91,9 +110,9 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
91
110
  state: import("zod").ZodOptional<import("zod").ZodString>;
92
111
  district: import("zod").ZodOptional<import("zod").ZodString>;
93
112
  office: import("zod").ZodOptional<import("zod").ZodEnum<{
113
+ P: "P";
94
114
  H: "H";
95
115
  S: "S";
96
- P: "P";
97
116
  }>>;
98
117
  party: import("zod").ZodOptional<import("zod").ZodString>;
99
118
  cycle: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -111,8 +130,8 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
111
130
  }>>;
112
131
  has_raised_funds: import("zod").ZodOptional<import("zod").ZodBoolean>;
113
132
  include_totals: import("zod").ZodOptional<import("zod").ZodBoolean>;
114
- page: import("zod").ZodOptional<import("zod").ZodNumber>;
115
- per_page: import("zod").ZodOptional<import("zod").ZodNumber>;
133
+ page: import("zod").ZodDefault<import("zod").ZodNumber>;
134
+ per_page: import("zod").ZodDefault<import("zod").ZodNumber>;
116
135
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
117
136
  candidates: import("zod").ZodArray<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
118
137
  totals: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>>;
@@ -138,8 +157,8 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
138
157
  designation: import("zod").ZodOptional<import("zod").ZodString>;
139
158
  cycle: import("zod").ZodOptional<import("zod").ZodNumber>;
140
159
  treasurer_name: import("zod").ZodOptional<import("zod").ZodString>;
141
- page: import("zod").ZodOptional<import("zod").ZodNumber>;
142
- per_page: import("zod").ZodOptional<import("zod").ZodNumber>;
160
+ page: import("zod").ZodDefault<import("zod").ZodNumber>;
161
+ per_page: import("zod").ZodDefault<import("zod").ZodNumber>;
143
162
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
144
163
  committees: import("zod").ZodArray<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
145
164
  pagination: import("zod").ZodObject<{
@@ -252,9 +271,9 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
252
271
  }>>;
253
272
  payee_name: import("zod").ZodOptional<import("zod").ZodString>;
254
273
  candidate_office: import("zod").ZodOptional<import("zod").ZodEnum<{
274
+ P: "P";
255
275
  H: "H";
256
276
  S: "S";
257
- P: "P";
258
277
  }>>;
259
278
  candidate_office_state: import("zod").ZodOptional<import("zod").ZodString>;
260
279
  candidate_party: import("zod").ZodOptional<import("zod").ZodString>;
@@ -297,13 +316,13 @@ export declare const allToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolD
297
316
  report_year: import("zod").ZodOptional<import("zod").ZodNumber>;
298
317
  cycle: import("zod").ZodOptional<import("zod").ZodNumber>;
299
318
  is_amended: import("zod").ZodOptional<import("zod").ZodBoolean>;
300
- most_recent: import("zod").ZodOptional<import("zod").ZodBoolean>;
319
+ most_recent: import("zod").ZodDefault<import("zod").ZodBoolean>;
301
320
  min_receipt_date: import("zod").ZodOptional<import("zod").ZodString>;
302
321
  max_receipt_date: import("zod").ZodOptional<import("zod").ZodString>;
303
- page: import("zod").ZodOptional<import("zod").ZodNumber>;
304
- per_page: import("zod").ZodOptional<import("zod").ZodNumber>;
322
+ page: import("zod").ZodDefault<import("zod").ZodNumber>;
323
+ per_page: import("zod").ZodDefault<import("zod").ZodNumber>;
305
324
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
306
- filings: import("zod").ZodArray<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
325
+ results: import("zod").ZodArray<import("zod").ZodObject<{}, import("zod/v4/core").$loose>>;
307
326
  pagination: import("zod").ZodObject<{
308
327
  page: import("zod").ZodNumber;
309
328
  pages: import("zod").ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAYrD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAU9B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAYrD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAU9B,CAAC"}
@@ -12,13 +12,32 @@ export declare const lookupCalendar: import("@cyanheads/mcp-ts-core").ToolDefini
12
12
  }>>;
13
13
  state: z.ZodOptional<z.ZodString>;
14
14
  office: z.ZodOptional<z.ZodEnum<{
15
+ P: "P";
15
16
  H: "H";
16
17
  S: "S";
17
- P: "P";
18
18
  }>>;
19
19
  report_type: z.ZodOptional<z.ZodString>;
20
20
  report_year: z.ZodOptional<z.ZodNumber>;
21
- category: z.ZodOptional<z.ZodString>;
21
+ category: z.ZodOptional<z.ZodEnum<{
22
+ 20: "20";
23
+ 21: "21";
24
+ 22: "22";
25
+ 23: "23";
26
+ 24: "24";
27
+ 25: "25";
28
+ 26: "26";
29
+ 27: "27";
30
+ 28: "28";
31
+ 29: "29";
32
+ 32: "32";
33
+ 33: "33";
34
+ 34: "34";
35
+ 36: "36";
36
+ 37: "37";
37
+ 38: "38";
38
+ 39: "39";
39
+ 40: "40";
40
+ }>>;
22
41
  election_year: z.ZodOptional<z.ZodNumber>;
23
42
  description: z.ZodOptional<z.ZodString>;
24
43
  min_date: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"lookup-calendar.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-calendar.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAUjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAuJzB,CAAC"}
1
+ {"version":3,"file":"lookup-calendar.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/lookup-calendar.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAWjD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAoKzB,CAAC"}
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { tool, z } from '@cyanheads/mcp-ts-core';
7
7
  import { getOpenFecService } from '../../../services/openfec/openfec-service.js';
8
- import { buildSearchCriteria, formatEmptyResult, renderRecord, SearchCriteriaSchema, } from './utils/format-helpers.js';
8
+ import { buildSearchCriteria, formatEmptyResult, PaginationSchema, renderRecord, SearchCriteriaSchema, } from './utils/format-helpers.js';
9
9
  export const lookupCalendar = tool('openfec_lookup_calendar', {
10
- description: 'Look up FEC calendar events, filing deadlines, and election dates.',
10
+ description: 'Look up FEC calendar events, filing deadlines, and election dates. Use to find upcoming filing windows for a committee, locate when a federal election occurred, or scope FEC events by date range and category.',
11
11
  annotations: { readOnlyHint: true, idempotentHint: true },
12
12
  input: z.object({
13
13
  mode: z
@@ -28,9 +28,28 @@ export const lookupCalendar = tool('openfec_lookup_calendar', {
28
28
  .describe('Report type code (e.g. "Q1", "Q2"). Filing deadlines mode only.'),
29
29
  report_year: z.number().int().optional().describe('Report year. Filing deadlines mode.'),
30
30
  category: z
31
- .string()
31
+ .enum([
32
+ '20',
33
+ '21',
34
+ '22',
35
+ '23',
36
+ '24',
37
+ '25',
38
+ '26',
39
+ '27',
40
+ '28',
41
+ '29',
42
+ '32',
43
+ '33',
44
+ '34',
45
+ '36',
46
+ '37',
47
+ '38',
48
+ '39',
49
+ '40',
50
+ ])
32
51
  .optional()
33
- .describe('Calendar category ID for events mode. Common values: "32" (reporting deadlines), "33" (election dates), "34" (quarterly filings). Events mode only.'),
52
+ .describe('Calendar category ID. 20=Commission Meetings, 21=Reporting Deadlines, 22=Conferences and Outreach, 23=AOs and Rules, 24=Other, 25=Quarterly, 26=Monthly, 27=Pre and Post-Elections, 28=EC Periods, 29=IE Periods, 32=Open Meetings, 33=Conferences, 34=Roundtables, 36=Election Dates, 37=Federal Holidays, 38=FEA Periods, 39=Executive Sessions, 40=Public Hearings. Events mode only.'),
34
53
  election_year: z.number().int().optional().describe('Election year. Election dates mode.'),
35
54
  description: z.string().optional().describe('Full-text event description search. Events mode.'),
36
55
  min_date: z.string().optional().describe('Earliest date (YYYY-MM-DD).'),
@@ -48,16 +67,9 @@ export const lookupCalendar = tool('openfec_lookup_calendar', {
48
67
  results: z
49
68
  .array(z
50
69
  .looseObject({})
51
- .describe('A calendar record (event, filing deadline, or election date depending on mode).'))
52
- .describe('Calendar records events, filing deadlines, or election dates depending on mode.'),
53
- pagination: z
54
- .object({
55
- page: z.number().describe('Current page number.'),
56
- pages: z.number().describe('Total pages available.'),
57
- count: z.number().describe('Total result count.'),
58
- per_page: z.number().describe('Results per page.'),
59
- })
60
- .describe('Page-based pagination metadata.'),
70
+ .describe('Event record (mode=events), filing deadline record (mode=filing_deadlines), or election date record (mode=election_dates).'))
71
+ .describe('Calendar result set; events, filing deadlines, or election dates depending on mode.'),
72
+ pagination: PaginationSchema,
61
73
  search_criteria: SearchCriteriaSchema,
62
74
  }),
63
75
  async handler(input, ctx) {