Skip to main content
Glama

sweden-parliament-mcp-server

Search parliamentary documents

riksdag_search_documents
Read-onlyIdempotent

Search Swedish parliamentary documents and consolidated SFS statutes by words, type, session, committee, ministry, party, member IID or dates, ordered by relevance or descending date. Follow nextCall for further pages; read status and text with riksdag_get_document.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "riksdag_search_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageNoRemote page number, starting at 1; the source serves the first 10,000 rows.
sortNoSource order: relevance for a nonblank query, else descending date.
partyNoParty code or exact reference label from riksdag_list_reference parties; the source files FP documents under L and KDS under KD, so those two are sent as their successor.
queryNoSource full-text query; narrow slow searches with session or type.
dateToNoInclusive end date, YYYY-MM-DD.
offsetNoIn-page row offset; follow nextCall, keeping the remote page size.
sessionNoParliamentary session; omit to search all sessions.
dateFromNoInclusive start date, YYYY-MM-DD.
memberIdNoNumeric member IID from riksdag_search_members, keeping leading zeros.
ministryNoPublishing ministry, copied from the committee field of a returned prop, dir or komm row of the same type and period; matched whole, ignoring case; cannot contain *, ? or a comma; not with committee.
pageSizeNoRemote page size; clamped to a maximum of 200.
revisionNoRemote-page revision from nextCall; a changed page is rejected.
committeeNoCommittee code or exact reference label; a code typed without its Swedish letter resolves (fou is FöU).
documentTypeNoDocument type code or exact reference label, including sfs.

Output Schema

NameRequiredDescriptionDefault
pageNoApplied page number, counted in pages of pageSize source hits.
errorNoPresent when the call failed. Absent on success.
itemsNoWhole records of this page's source hits, each once; member-profile, web-page and empty-ID calendar rows are skipped.
offsetNoApplied in-page row offset.
sourceNoRequired attribution to the Swedish Parliament.
hasMoreNoWhether local rows or another remote page remain.
noticesNoApplicable notices, possibly empty.
nextCallNoNext-page call with unchanged filters and page size.
pageSizeNoApplied page size in source hits.
revisionNoHash of the complete remote page.
totalCountNoAuthoritative source hit count, when published.
retrievedAtNoSource fetch time; unchanged on cache hits.
returnedCountNoRows returned.
upstreamQueryNoUpstream query echo, not proof a filter applied.
effectiveQueryNoNormalized input, defaults and local filters.
upstreamWarningsNoSource warnings.
remoteReturnedCountNoRecords on this page before the in-page offset, after skipped and merged rows.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / ministry
      Added value: +{
      +  "description": "Publishing ministry, copied from the committee field of a returned prop, dir or komm row of the same type and period; matched whole, ignoring case; cannot contain *, ? or a comma; not with committee.",
      +  "type": "string"
      +}
    • changedInput schema / properties / party / description
      Previous value: -"Party code or exact reference label."New value: +"Party code or exact reference label from riksdag_list_reference parties; the source files FP documents under L and KDS under KD, so those two are sent as their successor."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `revision_changed`: The remote page changed between calls. `invalid_filter`: Unknown code, nonconsecutive session, impossible date or reversed date range. `upstream_identity_mismatch`: Source rows contradict the filter identities. `upstream_schema_invalid`: Payload violates the wire contract. `upstream_unavailable`: Source unavailable after retries. `upstream_queue_full`: Upstream queue is full. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `revision_changed`: The remote page changed between calls. `invalid_filter`: Unknown code, nonconsecutive session, impossible date, reversed date range, ministry with committee, or ministry containing *, ? or a comma. `upstream_identity_mismatch`: Source rows contradict the filter identities. `upstream_schema_invalid`: Payload violates the wire contract. `upstream_unavailable`: Source unavailable after retries. `upstream_queue_full`: Upstream queue is full. Other values are possible when a failure originates below the handler."
  2. Changed7 schema fields changed
    • changedInput schema / properties / committee / description
      Previous value: -"Committee code or exact reference label."New value: +"Committee code or exact reference label; a code typed without its Swedish letter resolves (fou is FöU)."
    • changedInput schema / properties / page / description
      Previous value: -"Remote page number, starting at 1."New value: +"Remote page number, starting at 1; the source serves the first 10,000 rows."
    • changedInput schema / properties / pageSize / description
      Previous value: -"Remote page size; clamped to a maximum of 50."New value: +"Remote page size; clamped to a maximum of 200."
    • changedOutput schema / properties / items / description
      Previous value: -"Whole rows from the fetched remote page."New value: +"Whole records of this page's source hits, each once; member-profile, web-page and empty-ID calendar rows are skipped."
    • changedOutput schema / properties / page / description
      Previous value: -"Applied remote page."New value: +"Applied page number, counted in pages of pageSize source hits."
    • changedOutput schema / properties / pageSize / description
      Previous value: -"Applied remote page size."New value: +"Applied page size in source hits."
    • changedOutput schema / properties / remoteReturnedCount / description
      Previous value: -"Row count of the fetched remote page."New value: +"Records on this page before the in-page offset, after skipped and merged rows."
  3. Changed43 schema fields changed
    • changedInput schema / properties / dateFrom / description
      Previous value: -"Inclusive earliest ISO calendar date, YYYY-MM-DD."New value: +"Inclusive start date, YYYY-MM-DD."
    • addedInput schema / properties / dateFrom / pattern
      Added value: +"^\\s*(?:(?:[1-9]\\d{3}-\\d{2}-\\d{2})\\s*)?$"
    • changedInput schema / properties / dateTo / description
      Previous value: -"Inclusive latest ISO calendar date, YYYY-MM-DD."New value: +"Inclusive end date, YYYY-MM-DD."
    • addedInput schema / properties / dateTo / pattern
      Added value: +"^\\s*(?:(?:[1-9]\\d{3}-\\d{2}-\\d{2})\\s*)?$"
    • changedInput schema / properties / memberId / description
      Previous value: -"Numeric member IID from riksdag_search_members; leading zeros are preserved."New value: +"Numeric member IID from riksdag_search_members, keeping leading zeros."
    • addedInput schema / properties / memberId / pattern
      Added value: +"^\\s*(?:(?:\\d+)\\s*)?$"
    • changedInput schema / properties / offset / description
      Previous value: -"In-page row offset; follow nextCall without changing the remote page size."New value: +"In-page row offset; follow nextCall, keeping the remote page size."
    • changedInput schema / properties / pageSize / description
      Previous value: -"Requested remote page size; maximum applied size 50."New value: +"Remote page size; clamped to a maximum of 50."
    • changedInput schema / properties / revision / description
      Previous value: -"Remote-page revision from continuation; rejects changed pages."New value: +"Remote-page revision from nextCall; a changed page is rejected."
    • changedInput schema / properties / session / description
      Previous value: -"Parliamentary session; omission searches all available sessions."New value: +"Parliamentary session; omit to search all sessions."
    • addedInput schema / properties / session / pattern
      Added value: +"^\\s*(?:(?:[1-9]\\d{3}(?:\\/(?:\\d{2}|[1-9]\\d{3}))?)\\s*)?$"
    • changedInput schema / properties / sort / description
      Previous value: -"Source ordering; relevance for nonblank queries and descending date otherwise."New value: +"Source order: relevance for a nonblank query, else descending date."
    • changedOutput schema / anyOf
      Previous value: -[
      -  {
      -    "not": {
      -      "required": [
      -        "error"
      -      ]
      -    },
      -    "required": [
      -      "items",
      -      "page",
      -      "pageSize",
      -      "returnedCount",
      -      "offset",
      -      "remoteReturnedCount",
      -      "revision",
      -      "truncated",
      -      "hasMore",
      -      "effectiveQuery",
      -      "source",
      -      "retrievedAt",
      -      "notices"
      -    ]
      -  },
      -  {
      -    "required": [
      -      "error"
      -    ]
      -  }
      -]New value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "items",
      +      "page",
      +      "pageSize",
      +      "returnedCount",
      +      "offset",
      +      "remoteReturnedCount",
      +      "revision",
      +      "hasMore",
      +      "effectiveQuery",
      +      "source",
      +      "retrievedAt",
      +      "notices"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • changedOutput schema / properties / effectiveQuery / description
      Previous value: -"Deterministic normalized input, applied defaults and local filters."New value: +"Normalized input, defaults and local filters."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `revision_changed`: The remote page changed between continuation calls. `invalid_filter`: Unknown code or malformed date or session. `upstream_identity_mismatch`: Source rows contradict required filter identities. `upstream_schema_invalid`: Present payload violates the wire contract. `upstream_unavailable`: The source remains unavailable after retries. `upstream_queue_full`: The process upstream queue is full. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `revision_changed`: The remote page changed between calls. `invalid_filter`: Unknown code, nonconsecutive session, impossible date or reversed date range. `upstream_identity_mismatch`: Source rows contradict the filter identities. `upstream_schema_invalid`: Payload violates the wire contract. `upstream_unavailable`: Source unavailable after retries. `upstream_queue_full`: Upstream queue is full. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / items / description
      Previous value: -"Complete rows selected from the fetched remote page."New value: +"Whole rows from the fetched remote page."
    • changedOutput schema / properties / nextCall / description
      Previous value: -"Complete next-page call with unchanged filters and page size."New value: +"Next-page call with unchanged filters and page size."
    • changedOutput schema / properties / nextCall / properties / args / additionalProperties
      Previous value: -falseNew value: +{}
    • changedOutput schema / properties / nextCall / properties / args / description
      Previous value: -"Complete normalized next-page arguments."New value: +"Complete normalized arguments for riksdag_search_documents, valid against its input schema; pass back unchanged."
    • removedOutput schema / properties / nextCall / properties / args / properties / committee
      Removed value: -{
      -  "description": "Committee code or exact reference label.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / dateFrom
      Removed value: -{
      -  "description": "Inclusive earliest ISO calendar date, YYYY-MM-DD.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / dateTo
      Removed value: -{
      -  "description": "Inclusive latest ISO calendar date, YYYY-MM-DD.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / documentType
      Removed value: -{
      -  "description": "Document type code or exact reference label, including sfs.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / memberId
      Removed value: -{
      -  "description": "Numeric member IID from riksdag_search_members; leading zeros are preserved.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / offset
      Removed value: -{
      -  "default": 0,
      -  "description": "In-page row offset; follow nextCall without changing the remote page size.",
      -  "maximum": 9007199254740991,
      -  "minimum": 0,
      -  "type": "integer"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / page
      Removed value: -{
      -  "default": 1,
      -  "description": "Remote page number, starting at 1.",
      -  "maximum": 9007199254740991,
      -  "minimum": 1,
      -  "type": "integer"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / pageSize
      Removed value: -{
      -  "default": 10,
      -  "description": "Requested remote page size; maximum applied size 50.",
      -  "maximum": 9007199254740991,
      -  "minimum": 1,
      -  "type": "integer"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / party
      Removed value: -{
      -  "description": "Party code or exact reference label.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / query
      Removed value: -{
      -  "description": "Source full-text query; narrow slow searches with session or type.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / revision
      Removed value: -{
      -  "description": "Remote-page revision from continuation; rejects changed pages.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / session
      Removed value: -{
      -  "description": "Parliamentary session; omission searches all available sessions.",
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / properties / sort
      Removed value: -{
      -  "description": "Source ordering; relevance for nonblank queries and descending date otherwise.",
      -  "enum": [
      -    "relevance",
      -    "date"
      -  ],
      -  "type": "string"
      -}
    • removedOutput schema / properties / nextCall / properties / args / required
      Removed value: -[
      -  "offset",
      -  "page",
      -  "pageSize"
      -]
    • changedOutput schema / properties / notices / description
      Previous value: -"All applicable notices, including an empty list."New value: +"Applicable notices, possibly empty."
    • changedOutput schema / properties / notices / items / description
      Previous value: -"A source limitation, applied bound or next-step notice."New value: +"A limitation, applied bound or next-step notice."
    • changedOutput schema / properties / remoteReturnedCount / description
      Previous value: -"Complete fetched remote-page row count."New value: +"Row count of the fetched remote page."
    • changedOutput schema / properties / retrievedAt / description
      Previous value: -"Source fetch time, retained unchanged on cache hits."New value: +"Source fetch time; unchanged on cache hits."
    • changedOutput schema / properties / returnedCount / description
      Previous value: -"Actual rows returned."New value: +"Rows returned."
    • changedOutput schema / properties / revision / description
      Previous value: -"Hash of the complete normalized remote page."New value: +"Hash of the complete remote page."
    • removedOutput schema / properties / truncated
      Removed value: -{
      -  "description": "Whether response fitting shortened this local page.",
      -  "type": "boolean"
      -}
    • changedOutput schema / properties / upstreamQuery / description
      Previous value: -"Upstream query echo; not proof that a filter was applied."New value: +"Upstream query echo, not proof a filter applied."
    • changedOutput schema / properties / upstreamWarnings / description
      Previous value: -"Warnings supplied by the source."New value: +"Source warnings."
    • changedOutput schema / properties / upstreamWarnings / items / description
      Previous value: -"An upstream warning preserved verbatim."New value: +"An upstream warning, verbatim."
  4. First observed

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint and idempotentHint, so the safety profile is covered. The description adds pagination behavior (nextCall, descending date default) that goes beyond annotations, but omits the documented source limits (first 10,000 rows, page size clamped to 200) that live only in the schema. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the searchable dimensions, then pagination and the content-retrieval handoff. The first sentence is dense but earns its length by enumerating facets; nothing is redundant with the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 14-parameter open-world search with a full output schema, the description covers purpose, faceting, sorting, and paging correctly. The remaining gaps (row cap, page-size clamp, mutual exclusions) are documented in the schema, so an agent will not go materially wrong, but the description could have flagged them since they cause hard failures.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so a baseline of 3 applies, and the description earns above that by summarizing the full faceting model (words, type, session, committee, ministry, party, member IID, dates) and both sort modes in one clause. It does not restate the party mapping or the ministry/committee exclusivity, so the schema still carries the decisive details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (search), specific resources (Swedish parliamentary documents and consolidated SFS statutes), and enumerates the dimensions searchable (words, type, session, committee, ministry, party, member IID, dates) with sort order. This clearly distinguishes it from riksdag_search_members, riksdag_search_speeches, and riksdag_get_document.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names one explicit handoff: follow nextCall for further pages, and read status/text with riksdag_get_document, which routes the agent away from using this tool for content retrieval. However, it gives no guidance on when to prefer riksdag_search_speeches vs this tool, and no exclusion rules such as the ministry/committee mutual exclusion that only appears in the schema.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.