get_bound_congressional_record
Retrieve bound congressional record data from Congress.gov by specifying date ranges or specific dates to access official legislative proceedings and debates.
Instructions
Retrieve bound congressional record information from the Congress.gov API. Full documentation for this endpoint -> https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/BoundCongressionalRecordEndpoint.md
Args: year: Year month: Month (1-12) day: Day (1-31) offset: Starting record (default 0) limit: Maximum records to return (max 250, default 20) from_datetime: Start timestamp (YYYY-MM-DDTHH:MM:SSZ format) to_datetime: End timestamp (YYYY-MM-DDTHH:MM:SSZ format)
Returns: dict: Bound congressional record data from Congress.gov API
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | ||
| month | No | ||
| day | No | ||
| offset | No | ||
| limit | No | ||
| from_datetime | No | ||
| to_datetime | No |
Implementation Reference
- server.py:790-847 (handler)The handler function decorated with @mcp.tool(), implementing the core logic to query the Congress.gov API for bound congressional records by constructing the URL with year/month/day and handling pagination and date range filters. Includes input schema via type annotations and docstring.@mcp.tool() async def get_bound_congressional_record( year: int | None = None, month: int | None = None, day: int | None = None, offset: int = 0, limit: int = 20, from_datetime: str | None = None, to_datetime: str | None = None ) -> dict: """ Retrieve bound congressional record information from the Congress.gov API. Full documentation for this endpoint -> https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/BoundCongressionalRecordEndpoint.md Args: year: Year month: Month (1-12) day: Day (1-31) offset: Starting record (default 0) limit: Maximum records to return (max 250, default 20) from_datetime: Start timestamp (YYYY-MM-DDTHH:MM:SSZ format) to_datetime: End timestamp (YYYY-MM-DDTHH:MM:SSZ format) Returns: dict: Bound congressional record data from Congress.gov API """ base_url = "https://api.congress.gov/v3/bound-congressional-record" url = base_url if year: url += f"/{year}" if month: url += f"/{month:02d}" if day: url += f"/{day:02d}" params = { "api_key": congress_gov_api_key, "format": "json", "offset": offset, "limit": min(limit, 250) } if from_datetime: params["fromDateTime"] = from_datetime if to_datetime: params["toDateTime"] = to_datetime try: response = requests.get(url, params=params) response.raise_for_status() return response.json() except requests.exceptions.RequestException as e: return { "error": f"Failed to retrieve bound congressional record information: {str(e)}", "status_code": getattr(e.response, "status_code", None) }
- server.py:790-790 (registration)The @mcp.tool() decorator registers the get_bound_congressional_record function as an MCP tool with the name matching the function name.@mcp.tool()