GnistAI GnistAI
Log in

Getting Started with Legislation

Unified legislative search across US Congress, EU EUR-Lex, Finnish Finlex, Norwegian Stortinget, and Swedish Riksdagen — bills, regulations, directives, and parliamentary cases.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Government

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

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "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")

ParameterTypeRequiredDescription
querystringrequiredSearch query — keywords, bill name, or topic.
max_resultsintegeroptionalMaximum number of results per source. (default: 10)
yearanyoptionalFilter by year.
jurisdictionanyoptionalFilter 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)

ParameterTypeRequiredDescription
max_resultsintegeroptionalMaximum results per source. (default: 10)
jurisdictionanyoptionalFilter 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'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (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

Search then retrieve
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.
Pagination
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.

Next Steps

Related Tutorials