/** * Congress.gov SDK — typed API client for the Congress.gov API (v3). * * Standalone — no MCP server required. Usage: * * import { searchBills, getBillDetails } from "us-gov-open-data-mcp/sdk/congress"; * * Requires DATA_GOV_API_KEY env var. Get one at https://api.data.gov/signup/ */ export * from "./types.js"; import type { CongressBill, CongressBillDetail, CongressCosponsor, CongressBillTitle, CongressLaw, CongressSponsoredBill, CongressRelatedBill, CongressAction, CongressSubject, CongressSummary, CongressStandaloneSummary, CongressTextVersion, CongressMember, CongressMemberDetail, CongressVoteSummary, CongressVoteMember, SenateVoteSummary, SenateVoteMember, CongressAmendment, CongressCommitteeRef, CongressCommittee, CongressCommitteeReport, CongressCommitteePrint, CongressCommitteeMeeting, CongressHearing, CongressNomination, CongressTreaty, CongressCrsReport, CongressCongressionalRecord, CongressDailyCongressionalRecord, CongressBoundCongressionalRecord, CongressHouseCommunication, CongressHouseRequirement, CongressSenateCommunication, CongressInfo } from "./types.js"; /** A sub-request of a composite call that failed; its data is returned empty. */ export interface PartialFailure { /** Which part failed (e.g. "actions", "hearings"). */ part: string; error: string; } /** Current congress number based on date. */ export declare function currentCongress(now?: Date): number; /** English ordinal: 119 → "119th", 121 → "121st", 122 → "122nd". */ export declare function ordinal(n: number): string; /** Calendar years a Congress spans, e.g. 119 → "2025-2026". */ export declare function congressYears(congress: number): string; /** "119th (2025-2026), 118th (2023-2024), 117th (2021-2022)" for the most recent congresses. */ export declare function recentCongressesLabel(count?: number, now?: Date): string; /** Bill type codes → display names (for keysEnum/describeEnum in tool parameters) */ export declare const BILL_TYPES: Record; /** Convert a bill type code to its Congress.gov URL segment. */ export declare function billTypeToUrlSegment(billType: string): string; /** Chamber codes */ export declare const CHAMBERS: { readonly house: "House of Representatives"; readonly senate: "Senate"; readonly joint: "Joint"; }; /** Amendment type codes */ export declare const AMENDMENT_TYPES: { readonly hamdt: "House Amendment"; readonly samdt: "Senate Amendment"; readonly suamdt: "Senate Unnumbered Amendment"; }; /** Law type codes (for /law/{congress}/{lawType} filtering) */ export declare const LAW_TYPES: { readonly pub: "Public Law"; readonly priv: "Private Law"; }; /** Committee report type codes */ export declare const REPORT_TYPES: { readonly hrpt: "House Report"; readonly srpt: "Senate Report"; readonly erpt: "Executive Report"; }; /** House communication type codes */ export declare const HOUSE_COMMUNICATION_TYPES: { readonly ec: "Executive Communication"; readonly ml: "Memorial"; readonly pm: "Presidential Message"; readonly pt: "Petition"; }; /** Senate communication type codes */ export declare const SENATE_COMMUNICATION_TYPES: { readonly ec: "Executive Communication"; readonly pm: "Presidential Message"; readonly pom: "Petition or Memorial"; }; /** Congress number → calendar years, from the 111th through the current Congress. */ export declare const congressNumbers: Record; /** * Search/list bills by congress number and/or bill type. * * Without `query`, lists bills from the Congress.gov API (sorted by latest * update). With `query`, runs a full-text search of bill text through GovInfo * (see `searchBillsByKeyword`) — the Congress.gov API has no keyword search. */ export declare function searchBills(opts?: { query?: string; congress?: number; bill_type?: string; limit?: number; offset?: number; fromDateTime?: string; toDateTime?: string; sort?: string; }): Promise<{ bills: CongressBill[]; keyword?: Omit; }>; /** Most bills returned (and hydrated from Congress.gov) per keyword search call. */ export declare const KEYWORD_SEARCH_MAX_BILLS = 20; /** Parse a GovInfo BILLS package ID such as "BILLS-119hr1234ih". */ export declare function parseBillPackageId(packageId: string): { congress: number; type: string; number: number; version: string; } | null; /** Result of a keyword bill search. */ export interface BillKeywordSearch { bills: CongressBill[]; /** Matching bill-text documents in GovInfo (all versions, before de-duplication). */ textHits: number; /** Distinct bills among the relevance-ranked hits scanned. */ matchingBills: number; /** Bills whose Congress.gov details couldn't be loaded (GovInfo title only). */ detailFailures: number; } /** * Full-text keyword search of bill text via GovInfo's BILLS collection, * ranked by relevance. Text versions are de-duplicated into bills, then each * returned bill is hydrated with sponsor/latest action from Congress.gov. * Supports GovInfo query syntax (quoted phrases, AND/OR). `offset` pages * through the top relevance-ranked hits. */ export declare function searchBillsByKeyword(opts: { query: string; congress?: number; bill_type?: string; limit?: number; offset?: number; }): Promise; /** Get detailed information about a specific bill, including cosponsors with party breakdown. */ export declare function getBillDetails(congress: number, billType: string, billNumber: number): Promise<{ bill: CongressBillDetail; cosponsors: CongressCosponsor[]; cosponsorPartyBreakdown: Record; }>; /** Search members of Congress by state, congress, and/or district. */ export declare function searchMembers(opts?: { congress?: number; state?: string; district?: number; currentMember?: boolean; fromDateTime?: string; toDateTime?: string; limit?: number; }): Promise<{ members: CongressMember[]; }>; /** * Get House roll call votes. * * Primary source: Congress.gov API (118th Congress onward, beta). * Fallback: clerk.house.gov XML (coverage: 1990 to present) — fills gaps * where the API returns no data (e.g. older congresses). * * Data sources: * - https://api.congress.gov/v3/house-vote * - https://clerk.house.gov/Votes */ export declare function getHouseVotes(opts?: { congress?: number; session?: number; vote_number?: number; year?: number; limit?: number; }): Promise<{ votes?: CongressVoteSummary[]; members?: CongressVoteMember[]; vote?: CongressVoteSummary; partyTally?: Record>; source?: string; }>; /** Get recently enacted laws, optionally filtered by type (public/private). */ export declare function getRecentLaws(opts?: { congress?: number; lawType?: string; limit?: number; }): Promise<{ laws: CongressLaw[]; }>; /** Get bills sponsored or cosponsored by a specific member. */ export declare function getMemberBills(bioguideId: string, type?: "sponsored" | "cosponsored", limit?: number): Promise<{ bills: CongressSponsoredBill[]; }>; /** Get the action history / timeline for a bill. */ export declare function getBillActions(congress: number, billType: string, billNumber: number, limit?: number): Promise<{ actions: CongressAction[]; }>; /** Get amendments filed on a bill. */ export declare function getBillAmendments(congress: number, billType: string, billNumber: number, limit?: number): Promise<{ amendments: CongressAmendment[]; }>; /** Get committees a bill was referred to. */ export declare function getBillCommittees(congress: number, billType: string, billNumber: number): Promise<{ committees: CongressCommitteeRef[]; }>; /** Get related/companion bills. */ export declare function getBillRelatedBills(congress: number, billType: string, billNumber: number, limit?: number): Promise<{ relatedBills: CongressRelatedBill[]; }>; /** Get legislative subjects tagged on a bill. */ export declare function getBillSubjects(congress: number, billType: string, billNumber: number, limit?: number): Promise<{ subjects: CongressSubject[]; policyArea?: string; }>; /** Get CRS summaries of a bill. */ export declare function getBillSummaries(congress: number, billType: string, billNumber: number): Promise<{ summaries: CongressSummary[]; }>; /** Get text versions available for a bill. */ export declare function getBillTextVersions(congress: number, billType: string, billNumber: number): Promise<{ textVersions: CongressTextVersion[]; }>; /** Get titles (short, official, display) for a bill. */ export declare function getBillTitles(congress: number, billType: string, billNumber: number, limit?: number): Promise<{ titles: CongressBillTitle[]; }>; /** Get cosponsors for a bill (standalone, with sort support). */ export declare function getBillCosponsors(congress: number, billType: string, billNumber: number, opts?: { limit?: number; sort?: string; }): Promise<{ cosponsors: CongressCosponsor[]; }>; /** Get detailed information about a specific member by bioguide ID. */ export declare function getMemberDetails(bioguideId: string): Promise<{ member: CongressMemberDetail; }>; /** Search/list amendments. */ export declare function searchAmendments(opts?: { congress?: number; amendmentType?: string; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ amendments: CongressAmendment[]; }>; /** Get details about a specific amendment (includes actions). */ export declare function getAmendmentDetails(congress: number, amendmentType: string, amendmentNumber: number | string): Promise<{ amendment: CongressAmendment; actions: CongressAction[]; }>; /** List congressional committees. */ export declare function listCommittees(opts?: { congress?: number; chamber?: string; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ committees: CongressCommittee[]; }>; /** Get detailed committee info. */ export declare function getCommitteeDetails(chamber: string, committeeCode: string): Promise<{ committee: CongressCommittee; }>; /** Get bills assigned to a committee. */ export declare function getCommitteeBills(chamber: string, committeeCode: string, limit?: number): Promise<{ bills: CongressBill[]; }>; /** List presidential nominations for a congress. */ export declare function listNominations(opts?: { congress?: number; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ nominations: CongressNomination[]; }>; /** Get details about a specific nomination (includes actions). */ export declare function getNominationDetails(congress: number, nominationNumber: number | string): Promise<{ nomination: CongressNomination; actions: CongressAction[]; }>; /** List treaties. */ export declare function listTreaties(opts?: { congress?: number; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ treaties: CongressTreaty[]; }>; /** Get details about a specific treaty (includes actions). */ export declare function getTreatyDetails(congress: number, treatyNumber: number | string): Promise<{ treaty: CongressTreaty; actions: CongressAction[]; }>; /** Search Congressional Research Service reports. */ export declare function searchCrsReports(opts?: { limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ reports: CongressCrsReport[]; }>; /** Get a specific CRS report by report number. */ export declare function getCrsReportDetails(reportNumber: string): Promise<{ report: CongressCrsReport; }>; /** * Search bill summaries across congresses. * Unlike getBillSummaries (which requires a specific bill), this endpoint * returns summaries across all bills, optionally filtered by congress and bill type. */ export declare function searchSummaries(opts?: { congress?: number; billType?: string; limit?: number; fromDateTime?: string; toDateTime?: string; sort?: string; }): Promise<{ summaries: CongressStandaloneSummary[]; }>; /** Get info about congresses and their sessions. */ export declare function getCongressInfo(opts?: { congress?: number; current?: boolean; limit?: number; }): Promise<{ congresses: CongressInfo[]; }>; /** Get Congressional Record issues. */ export declare function getCongressionalRecord(opts?: { year?: number; month?: number; day?: number; limit?: number; }): Promise<{ issues: CongressCongressionalRecord[]; }>; /** Get details about a specific law by congress, type, and number. */ export declare function getLawDetails(congress: number, lawType: string, lawNumber: number): Promise<{ law: CongressBillDetail; }>; /** Get cosponsors of an amendment. */ export declare function getAmendmentCosponsors(congress: number, amendmentType: string, amendmentNumber: number | string, limit?: number): Promise<{ cosponsors: CongressCosponsor[]; }>; /** Get sub-amendments to an amendment. */ export declare function getAmendmentAmendments(congress: number, amendmentType: string, amendmentNumber: number | string, limit?: number): Promise<{ amendments: CongressAmendment[]; }>; /** Get text versions of an amendment (117th Congress onwards). */ export declare function getAmendmentText(congress: number, amendmentType: string, amendmentNumber: number | string, limit?: number): Promise<{ textVersions: CongressTextVersion[]; }>; /** Get committee details filtered by congress. */ export declare function getCommitteeDetailsByCongress(congress: number, chamber: string, committeeCode: string): Promise<{ committee: CongressCommittee; }>; /** Get reports associated with a committee. */ export declare function getCommitteeReportsForCommittee(chamber: string, committeeCode: string, limit?: number, opts?: { fromDateTime?: string; toDateTime?: string; }): Promise<{ reports: CongressCommitteeReport[]; }>; /** Get nominations associated with a committee. */ export declare function getCommitteeNominations(chamber: string, committeeCode: string, limit?: number): Promise<{ nominations: CongressNomination[]; }>; /** Get House communications associated with a committee. */ export declare function getCommitteeHouseCommunications(committeeCode: string, limit?: number): Promise<{ communications: CongressHouseCommunication[]; }>; /** Get Senate communications associated with a committee. */ export declare function getCommitteeSenateCommunications(committeeCode: string, limit?: number): Promise<{ communications: CongressSenateCommunication[]; }>; /** List committee reports. */ export declare function listCommitteeReports(opts?: { congress?: number; reportType?: string; conference?: boolean; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ reports: CongressCommitteeReport[]; }>; /** Get details about a specific committee report. */ export declare function getCommitteeReportDetails(congress: number, reportType: string, reportNumber: number): Promise<{ report: CongressCommitteeReport; }>; /** Get text versions for a committee report. */ export declare function getCommitteeReportText(congress: number, reportType: string, reportNumber: number, limit?: number): Promise<{ text: { type?: string; url?: string; isErrata?: string; }[]; }>; /** List committee prints. */ export declare function listCommitteePrints(opts?: { congress?: number; chamber?: string; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ prints: CongressCommitteePrint[]; }>; /** Get details about a specific committee print. */ export declare function getCommitteePrintDetails(congress: number, chamber: string, jacketNumber: number): Promise<{ print: CongressCommitteePrint; }>; /** List committee meetings. */ export declare function listCommitteeMeetings(opts?: { congress?: number; chamber?: string; limit?: number; fromDateTime?: string; toDateTime?: string; }): Promise<{ meetings: CongressCommitteeMeeting[]; }>; /** Get details about a specific committee meeting. */ export declare function getCommitteeMeetingDetails(congress: number, chamber: string, eventId: string): Promise<{ meeting: CongressCommitteeMeeting; }>; /** List hearings. */ export declare function listHearings(opts?: { congress?: number; chamber?: string; limit?: number; }): Promise<{ hearings: CongressHearing[]; }>; /** Get details about a specific hearing. */ export declare function getHearingDetails(congress: number, chamber: string, jacketNumber: number): Promise<{ hearing: CongressHearing; }>; /** List daily Congressional Record issues. */ export declare function getDailyCongressionalRecord(opts?: { volumeNumber?: number; issueNumber?: number; limit?: number; }): Promise<{ issues: CongressDailyCongressionalRecord[]; issue?: CongressDailyCongressionalRecord; }>; /** Get articles from a daily Congressional Record issue. */ export declare function getDailyCongressionalRecordArticles(volumeNumber: number, issueNumber: number, limit?: number): Promise<{ articles: { name?: string; sectionArticles?: { startPage?: string; endPage?: string; title?: string; text?: { type?: string; url?: string; }[]; }[]; }[]; }>; /** List bound Congressional Record issues. */ export declare function getBoundCongressionalRecord(opts?: { year?: number; month?: number; day?: number; limit?: number; }): Promise<{ records: CongressBoundCongressionalRecord[]; }>; /** List House communications. */ export declare function listHouseCommunications(opts?: { congress?: number; communicationType?: string; limit?: number; }): Promise<{ communications: CongressHouseCommunication[]; }>; /** Get details about a specific House communication. */ export declare function getHouseCommunicationDetails(congress: number, communicationType: string, communicationNumber: number): Promise<{ communication: CongressHouseCommunication; }>; /** List House requirements. */ export declare function listHouseRequirements(opts?: { limit?: number; }): Promise<{ requirements: CongressHouseRequirement[]; }>; /** Get details about a specific House requirement. */ export declare function getHouseRequirementDetails(requirementNumber: number): Promise<{ requirement: CongressHouseRequirement; }>; /** Get matching communications for a House requirement. */ export declare function getHouseRequirementMatchingCommunications(requirementNumber: number, limit?: number): Promise<{ communications: CongressHouseCommunication[]; }>; /** List Senate communications. */ export declare function listSenateCommunications(opts?: { congress?: number; communicationType?: string; limit?: number; }): Promise<{ communications: CongressSenateCommunication[]; }>; /** Get details about a specific Senate communication. */ export declare function getSenateCommunicationDetails(congress: number, communicationType: string, communicationNumber: number): Promise<{ communication: CongressSenateCommunication; }>; /** Get nominees for a position within a nomination. */ export declare function getNominationNominees(congress: number, nominationNumber: number | string, ordinal: number, limit?: number): Promise<{ nominees: { firstName?: string; lastName?: string; state?: string; effectiveDate?: string; [key: string]: unknown; }[]; }>; /** Get committees associated with a nomination. */ export declare function getNominationCommittees(congress: number, nominationNumber: number | string, limit?: number): Promise<{ committees: CongressCommitteeRef[]; }>; /** Get hearings associated with a nomination. */ export declare function getNominationHearings(congress: number, nominationNumber: number | string, limit?: number): Promise<{ hearings: CongressHearing[]; }>; /** Get details about a specific partitioned treaty. */ export declare function getTreatyDetailWithSuffix(congress: number, treatyNumber: number | string, treatySuffix: string): Promise<{ treaty: CongressTreaty; }>; /** Get committees associated with a treaty. */ export declare function getTreatyCommittees(congress: number, treatyNumber: number | string, limit?: number): Promise<{ committees: CongressCommitteeRef[]; }>; /** Get actions on a partitioned treaty (with suffix). */ export declare function getTreatyActionsWithSuffix(congress: number, treatyNumber: number | string, treatySuffix: string, limit?: number): Promise<{ actions: CongressAction[]; }>; /** Get text versions for a committee print. */ export declare function getCommitteePrintText(congress: number, chamber: string, jacketNumber: number, limit?: number): Promise<{ text: { type?: string; url?: string; }[]; }>; /** * Get a complete bill profile by combining multiple sub-resource calls in parallel. * Returns bill details, cosponsors, actions, summaries, committees, subjects, text versions, * and related bills — everything needed to understand a bill's full legislative context. * Sub-resources that fail to load are empty and listed in `partialFailures`. */ export declare function getBillFullProfile(congress: number, billType: string, billNumber: number): Promise<{ bill: CongressBillDetail; cosponsors: CongressCosponsor[]; cosponsorPartyBreakdown: Record; actions: CongressAction[]; summaries: CongressSummary[]; committees: CongressCommitteeRef[]; subjects: CongressSubject[]; policyArea?: string; textVersions: CongressTextVersion[]; relatedBills: CongressRelatedBill[]; titles: CongressBillTitle[]; partialFailures: PartialFailure[]; }>; /** * Get a complete member profile: details + sponsored + cosponsored legislation in parallel. * Provides a 360° view of a member's legislative activity. */ export declare function getMemberFullProfile(bioguideId: string, billLimit?: number): Promise<{ member: CongressMemberDetail; sponsoredBills: CongressSponsoredBill[]; cosponsoredBills: CongressSponsoredBill[]; partialFailures: PartialFailure[]; }>; /** * Get a complete nomination profile: details + actions + committees + hearings in parallel. */ export declare function getNominationFullProfile(congress: number, nominationNumber: number | string): Promise<{ nomination: CongressNomination; actions: CongressAction[]; committees: CongressCommitteeRef[]; hearings: CongressHearing[]; partialFailures: PartialFailure[]; }>; /** * Get a complete treaty profile: details + actions + committees in parallel. */ export declare function getTreatyFullProfile(congress: number, treatyNumber: number | string): Promise<{ treaty: CongressTreaty; actions: CongressAction[]; committees: CongressCommitteeRef[]; partialFailures: PartialFailure[]; }>; /** * Get a complete committee profile: details + recent bills + reports + nominations in parallel. */ export declare function getCommitteeFullProfile(chamber: string, committeeCode: string, limit?: number): Promise<{ committee: CongressCommittee; recentBills: CongressBill[]; reports: CongressCommitteeReport[]; nominations: CongressNomination[]; partialFailures: PartialFailure[]; }>; /** * Extract recorded vote references from a bill's actions, then fetch the actual vote data. * Connects bills to their roll-call votes with party breakdowns — the key bridge * for "follow the money" investigations (bill → vote → who voted how → who donated to them). */ export declare function getBillVotes(congress: number, billType: string, billNumber: number): Promise<{ houseVotes: { rollNumber: number; date?: string; vote?: CongressVoteSummary; members?: CongressVoteMember[]; partyTally?: Record>; source?: string; }[]; senateVotes: { rollNumber: number; date?: string; vote?: SenateVoteSummary; members?: SenateVoteMember[]; partyTally?: Record>; }[]; }>; /** * Get Senate roll call votes from senate.gov XML data. * * Coverage: 101st Congress (1989) to present — far deeper than the Congress.gov API * which only has House votes from the 118th Congress onward. * * Data source: https://www.senate.gov/general/XML.htm */ export declare function getSenateVotes(opts?: { congress?: number; session?: number; vote_number?: number; limit?: number; }): Promise<{ votes?: SenateVoteSummary[]; vote?: SenateVoteSummary; members?: SenateVoteMember[]; partyTally?: Record>; }>; /** Clear cached responses. */ export declare function clearCache(): void; //# sourceMappingURL=sdk.d.ts.map