Data source: Congress.gov, EUR-Lex, Finlex, Stortinget, Riksdagen
Overview
Legislation searches across 5 data sources (Congress.gov, EUR-Lex, Finlex, Stortinget, Riksdagen) in a single query. It deduplicates and normalizes results, saving you from building 5 separate integrations. This tutorial walks through all 4 tools with working code examples.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-legislation": {
"url": "https://context.gnist.ai/mcp/legislation/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (4)
search_legislation
Search legislation across US Congress, EU EUR-Lex, Finnish Finlex, Norwegian Stortinget, and Swedish Riksdagen. Queries all legislative databases in parallel and returns unified results sorted by date (most recent first). Each result includes the jurisdiction, identifier, title, status, and a link to the original source. Examples: search_legislation(query="climate change") search_legislation(query="artificial intelligence", jurisdiction="EU") search_legislation(query="tax reform", year=2025, jurisdiction="US")
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Search query — keywords, bill name, or topic. |
max_results | integer | optional | Maximum number of results per source. (default: 10) |
year | any | optional | Filter by year. |
jurisdiction | any | optional | Filter by jurisdiction: US, EU, FI, NO, or SE. Omit to search all. |
curl -X POST "https://context.gnist.ai/mcp/legislation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_legislation", "arguments": {"query": "renewable energy"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/legislation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'query': 'renewable energy'},
'name': 'search_legislation'}},
)
print(resp.json())
get_recent_legislation
Get recent legislative activity across all jurisdictions. Returns the most recent bills, regulations, and parliamentary cases from US Congress, EU EUR-Lex, Finnish Finlex, Norwegian Stortinget, and Swedish Riksdagen. Examples: get_recent_legislation() get_recent_legislation(jurisdiction="NO", max_results=5)
| Parameter | Type | Required | Description |
|---|---|---|---|
max_results | integer | optional | Maximum results per source. (default: 10) |
jurisdiction | any | optional | Filter by jurisdiction: US, EU, FI, NO, or SE. Omit for all. |
curl -X POST "https://context.gnist.ai/mcp/legislation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_recent_legislation", "arguments": {"max_results": 10}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/legislation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'max_results': 10}, 'name': 'get_recent_legislation'}},
)
print(resp.json())
list_legislation_sources
List all registered legislative data sources and their status. Examples: list_legislation_sources()
curl -X POST "https://context.gnist.ai/mcp/legislation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_legislation_sources", "arguments": {}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/legislation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {}, 'name': 'list_legislation_sources'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/legislation/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/legislation/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
Common Patterns
Use
search_legislation to find items, then get_recent_legislation to get full details. This two-step pattern is common for exploring data before drilling down.Several tools support
limit, offset, or page parameters. Start with small limits during development, then increase for production queries.FAQ
What data does Legislation provide?
Unified legislative search across US Congress, EU EUR-Lex, Finnish Finlex, Norwegian Stortinget, and Swedish Riksdagen — bills, regulations, directives, and parliamentary cases. It exposes 4 tools: search_legislation, get_recent_legislation, list_legislation_sources, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the Legislation API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.
Which data sources does Legislation aggregate?
Congress.gov, EUR-Lex, Finlex, Stortinget, Riksdagen. Results are deduplicated and normalized into a consistent format.