Repository navigation
Add a get_bill MCP tool for looking up one bill by number - #2396
Open
rmabualhaija wants to merge 2 commits into
Open
rmabualhaija wants to merge 2 commits into
rmabualhaija wants to merge 2 commits into
Conversation
The MCP server installs with npm (its Dockerfile runs `npm ci`), but package-lock.json is gitignored repo-wide, so a fresh clone couldn't build the image and each install resolved dependency versions anew. A fresh install can now pull @firebase/database-compat 2.1.8, which requires Node >= 24; the committed lockfile pins 2.1.7, which every locked package's engines allow on both Node 20 (the current image) and Node 22. Update the auth tests for the `help` field auth.ts now adds to 401 responses, and add an MCP Server job to Repo Checks that type-checks and tests mcp-server on Node 22. The Docker image stays on Node 20 here; moving it to 22 needs its own deploy test, as in the Node 22 upgrade that left this Dockerfile out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The MCP server's tools all search by meaning; none returns a known
bill. get_bill takes the bill number however it's written ("H.100",
"H 100", "h100") and returns the full record: sponsors and cosponsors,
committee and its recommendations, the latest action and full history,
hearings, canonical MAPLE and malegislature.gov links, and when MAPLE
last refreshed the bill.
A missing bill comes back as found: false with a message, not an
error, so callers can say "not found" without guessing. There is no
status field because the legislature's API has none; latestAction
stands in for it. MAPLE's AI summary and topics are kept under
aiGenerated, apart from the legislature's record. Full text is opt-in,
with its length always given, since some bills run to hundreds of
pages. Dates are ISO strings rather than raw Firestore Timestamps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rmabualhaija
marked this pull request as ready for review
November 26, 2026 19:15
rmabualhaija
requested review from
Mephistic,
alexjball,
kiminkim724,
mertbagt,
mvictor55,
nesanders,
sashamaryl and
timblais
as code owners
November 26, 2026 19:15
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
get_billto the MCP server: look up one bill by its number and get its full record. Every existing tool searches by meaning, so none of them can answer "tell me about H.100". This is the first exact-lookup tool for the Legislator Research Assistant (tracking: rmabualhaija#2), and it sets the response conventions the next ones will reuse.billId, written any common way (H.100,H 100,h100), an optionalcourt(defaults to the current session) andincludeFullText(defaultfalse).asOf,sources[]).{ found: false, message }. This applies both to a bill that doesn't exist and to input that isn't a bill number.Choices worth a look:
statusfield. The legislature's API has none.latestActionstands in for it, so the tool never states a status the legislature didn't.aiGenerated, labeled, so they aren't mistaken for the official record.text.lengthis always given. Some bills, like the budget, run to hundreds of pages.cosponsorCount.{_seconds, _nanoseconds}). The scraper's epoch placeholder for "no hearing" becomesnull.text.asOfis the last refresh. Detecting struck-and-replaced text is a separate issue.New helpers in
tools.ts(bill-number normalizing, links, dates, JSON results) are written to be reused by the next lookup tools. Existing tools are unchanged.Checklist
firestore.indexes.json. (A single-document read by path, no index needed.)Screenshots
N/A. Calling the tool through an MCP client:
Known issues
nextHearingAtinshapeBill). Left alone here to keep this PR additive, easy follow-up.Extra Deploy Steps
None beyond the MCP server's usual manual Cloud Run deploy.
Steps to test/reproduce
cd mcp-server && npm ci && npm test: 64 tests pass (27 new).H.99999returnsfound: false.🤖 Generated with Claude Code