get_bound_congressional_record
Retrieve bound congressional record data from Congress.gov by specifying date ranges or specific dates to access official U.S. Congressional 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 |
|---|---|---|---|
| day | No | ||
| from_datetime | No | ||
| limit | No | ||
| month | No | ||
| offset | No | ||
| to_datetime | No | ||
| year | No |
Implementation Reference
- server.py:790-847 (handler)The async handler function decorated with @mcp.tool(), implementing the core logic to query the Congress.gov API for bound congressional records based on date parameters and pagination. Handles API requests, parameters construction, and error handling.@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 this function as an MCP tool, automatically generating schema from type hints and docstring.@mcp.tool()