Skip to main content
Glama

uk-parliament-mcp-server

Search spoken Hansard

ukparl_search_hansard
Read-onlyIdempotent

Search spoken Westminster Hansard contributions by topic, member, House, date or numeric debateSectionId. Results run newest sitting first; sortOrder=SittingDateAsc starts from the oldest sitting. Returns full source contribution text where supplied, including HTML; previews are labelled summaries. Repeat with a returned debateSectionId to search that section, which does not establish an entire debate transcript. Historical completeness is not guaranteed, including the 2004–2006 website warning despite some API records. Use ukparl_lookup_reference topic=coverage for archive guidance. Follow collection cursors unchanged and contentCursor for lossless oversized contributions; retry timeouts with shorter date windows.

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": "ukparl_search_hansard"
  }
}

Input Schema

NameRequiredDescriptionDefault
houseNoCommons or Lords; exact official House aliases are accepted.
limitNoRequested whole contributions; default 5, cap 100; larger safe integers are capped with a notice.
queryNoSpoken contribution search text; no date range is inferred.
cursorNoOpaque collection continuation; repeat the same filters and sortOrder. It resumes at its offset under any limit.
endDateNoInclusive latest sitting date, real YYYY-MM-DD; must not precede startDate.
memberIdNoMembers API identifier discovered with ukparl_search_members.
sortOrderNoSitting-date order: SittingDateDesc (newest first, the source default) or SittingDateAsc (oldest first). Contributions within one sitting keep source order.
startDateNoInclusive earliest sitting date, real YYYY-MM-DD; no inferred archive cutoff.
contentCursorNoOpaque lossless content continuation; preserve original selection and collection cursor.
debateSectionIdNoReturned numeric debateSectionId, distinct from external debate IDs. A section is one sitting, so either sortOrder keeps its source order, highest orderInDebateSection first; sort by orderInDebateSection to read it in sequence.

Output Schema

NameRequiredDescriptionDefault
capNoWhole-contribution page-size ceiling; a larger limit is clamped to it.
pageNoActual emitted whole-item continuation, independent of content delivery.
errorNoPresent when the call failed. Absent on success.
itemsNoWhole Spoken contributions ordered by sitting date per sortOrder, not by rank.
queryNoComplete normalized search text, reconstructable during content delivery.
shownNoWhole contributions emitted or selected for reconstruction.
noticeNoLicence, coverage, missing-text, empty-result and clamped-limit guidance.
sourceNoExact official Spoken request provenance, including empty pages.
appliedNoNormalized filters and actual workload.
coverageNoHistorical source facts; samples never establish complete coverage.
deliveryNoFull selected payload, child outline, or JSON fragment.
identityNoStable selected-record identifiers retained during content retrieval.
retrievalNoSame-tool retrieval instruction.
truncatedNoFurther whole contributions remain; follow the collection cursor.
provenanceNoSelected response provenance retained during content retrieval; source notices remain in the reconstructed payload.
totalCountNoSource TotalResultCount.
contentPageNoLossless recursive content continuation.
searchTermsNoSource parsed terms, including explicit null.
collectionPageNoCollection continuation; reconstruct the outlined selected payload before following it.
requestedLimitNoOriginal request when above the workload cap.
spokenResultCountNoSource SpokenResultCount, distinct from total matches.
writtenResultCountNoSource WrittenResultCount metadata.
divisionsResultCountNoSource DivisionsResultCount metadata.
correctionsResultCountNoSource CorrectionsResultCount metadata.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed30 schema fields changed
    • changedInput schema / properties / cursor / description
      Previous value: -"Opaque collection continuation; repeat the same filters and effective limit."New value: +"Opaque collection continuation; repeat the same filters and sortOrder. It resumes at its offset under any limit."
    • changedInput schema / properties / debateSectionId / description
      Previous value: -"Returned numeric debateSectionId, distinct from external debate IDs."New value: +"Returned numeric debateSectionId, distinct from external debate IDs. A section is one sitting, so either sortOrder keeps its source order, highest orderInDebateSection first; sort by orderInDebateSection to read it in sequence."
    • changedInput schema / properties / limit / description
      Previous value: -"Requested whole contributions; default 5, effective cap 20 with notice."New value: +"Requested whole contributions; default 5, cap 100; larger safe integers are capped with a notice."
    • addedInput schema / properties / sortOrder
      Added value: +{
      +  "description": "Sitting-date order: SittingDateDesc (newest first, the source default) or SittingDateAsc (oldest first). Contributions within one sitting keep source order.",
      +  "enum": [
      +    "SittingDateAsc",
      +    "SittingDateDesc"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / $defs
      Added value: +{
      +  "Page": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "hasMore": {
      +        "description": "Further collection items remain.",
      +        "type": "boolean"
      +      },
      +      "nextCursor": {
      +        "description": "Opaque collection continuation; repeat the same filters.",
      +        "type": "string"
      +      },
      +      "returned": {
      +        "description": "Whole items emitted on this page.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "total": {
      +        "description": "Total supplied by the source or fully read local collection.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "returned",
      +      "hasMore"
      +    ],
      +    "type": "object"
      +  },
      +  "Source": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "api": {
      +        "description": "Official API namespace.",
      +        "enum": [
      +          "bills",
      +          "members",
      +          "commons_votes",
      +          "lords_votes",
      +          "hansard",
      +          "questions",
      +          "committees"
      +        ],
      +        "type": "string"
      +      },
      +      "licenceUrl": {
      +        "description": "Open Parliament Licence HTTPS URL; its exclusions still apply.",
      +        "type": "string"
      +      },
      +      "notices": {
      +        "description": "Source-specific notices.",
      +        "items": {
      +          "description": "Source notice preserved verbatim.",
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "retrievedAt": {
      +        "description": "Response retrieval time in ISO 8601 UTC.",
      +        "format": "date-time",
      +        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      +        "type": "string"
      +      },
      +      "url": {
      +        "description": "Actual official HTTPS request URL.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "api",
      +      "url",
      +      "retrievedAt",
      +      "licenceUrl"
      +    ],
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / applied / properties / sortOrder
      Added value: +{
      +  "description": "Applied sitting-date order; absent when the source default applies.",
      +  "enum": [
      +    "SittingDateAsc",
      +    "SittingDateDesc"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / cap / description
      Previous value: -"Actual collection workload cap."New value: +"Whole-contribution page-size ceiling; a larger limit is clamped to it."
    • addedOutput schema / properties / collectionPage / $ref
      Added value: +"#/$defs/Page"
    • removedOutput schema / properties / collectionPage / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / collectionPage / properties
      Removed value: -{
      -  "hasMore": {
      -    "description": "Further collection items remain.",
      -    "type": "boolean"
      -  },
      -  "nextCursor": {
      -    "description": "Opaque collection continuation; repeat the same filters.",
      -    "type": "string"
      -  },
      -  "returned": {
      -    "description": "Whole items emitted on this page.",
      -    "maximum": 9007199254740991,
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  "total": {
      -    "description": "Total supplied by the source or fully read local collection.",
      -    "maximum": 9007199254740991,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -}
    • removedOutput schema / properties / collectionPage / required
      Removed value: -[
      -  "returned",
      -  "hasMore"
      -]
    • removedOutput schema / properties / collectionPage / type
      Removed value: -"object"
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `http_invalid_params`: The official API returned HTTP 400 for this request. `http_unauthorized`: The official public API returned HTTP 401. `http_forbidden`: The official public API returned HTTP 402 or 403. `http_conflict`: The official API returned HTTP 409, 423 or 424. `http_rate_limited`: The official API returned HTTP 429 after bounded retry handling. `http_invalid_request`: The official API returned an unexpected redirect or another unsupported HTTP client response. `invalid_cursor`: Collection or content cursor is invalid or bound to another selection. `source_changed`: Selected contribution data changed during content reconstruction. `invalid_date_range`: Date bounds are impossible or reversed. `queue_full`: Hansard origin request queue is full. `attempt_timeout`: A Spoken source attempt timed out. `call_deadline_exceeded`: The shared call deadline elapsed while searching Spoken contributions. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `http_invalid_params`: The official API returned HTTP 400 for this request. `http_unauthorized`: The official public API returned HTTP 401. `http_forbidden`: The official public API returned HTTP 402 or 403. `http_conflict`: The official API returned HTTP 409, 423 or 424. `http_rate_limited`: The official API returned HTTP 429 after bounded retry handling. `http_invalid_request`: The official API returned an unexpected redirect or another unsupported HTTP client response. `invalid_cursor`: Collection or content cursor is invalid or bound to another selection. `source_changed`: Selected contribution data changed during content reconstruction. `invalid_date_range`: Date bounds are impossible or reversed. `queue_full`: Hansard origin request queue is full. `call_deadline_exceeded`: The 45-second call deadline elapsed while searching Spoken contributions. `http_server_error`: The official API returned an HTTP 5xx server error. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "http_invalid_params",
      -  "http_unauthorized",
      -  "http_forbidden",
      -  "http_conflict",
      -  "http_rate_limited",
      -  "http_invalid_request",
      -  "invalid_cursor",
      -  "source_changed",
      -  "invalid_date_range",
      -  "queue_full",
      -  "attempt_timeout",
      -  "call_deadline_exceeded"
      -]New value: +[
      +  "http_invalid_params",
      +  "http_unauthorized",
      +  "http_forbidden",
      +  "http_conflict",
      +  "http_rate_limited",
      +  "http_invalid_request",
      +  "invalid_cursor",
      +  "source_changed",
      +  "invalid_date_range",
      +  "queue_full",
      +  "call_deadline_exceeded",
      +  "http_server_error"
      +]
    • changedOutput schema / properties / items / description
      Previous value: -"Whole Spoken contributions in source search order."New value: +"Whole Spoken contributions ordered by sitting date per sortOrder, not by rank."
    • changedOutput schema / properties / items / items / description
      Previous value: -"One source Spoken contribution with exact text and provenance."New value: +"One source Spoken contribution with exact text."
    • changedOutput schema / properties / items / items / properties / rank / description
      Previous value: -"Source search rank, not a synthesized score."New value: +"Source search rank, not a synthesized score; results follow sitting date, not rank, and rank is 0 without search text."
    • removedOutput schema / properties / items / items / properties / source
      Removed value: -{
      -  "additionalProperties": false,
      -  "description": "Actual request provenance and licence.",
      -  "properties": {
      -    "api": {
      -      "description": "Official API namespace.",
      -      "enum": [
      -        "bills",
      -        "members",
      -        "commons_votes",
      -        "lords_votes",
      -        "hansard",
      -        "questions",
      -        "committees"
      -      ],
      -      "type": "string"
      -    },
      -    "licenceUrl": {
      -      "description": "Open Parliament Licence HTTPS URL; its exclusions still apply.",
      -      "type": "string"
      -    },
      -    "notices": {
      -      "description": "Source-specific notices.",
      -      "items": {
      -        "description": "Source notice preserved verbatim.",
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    "retrievedAt": {
      -      "description": "Response retrieval time in ISO 8601 UTC.",
      -      "format": "date-time",
      -      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      -      "type": "string"
      -    },
      -    "url": {
      -      "description": "Actual official HTTPS request URL.",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "api",
      -    "url",
      -    "retrievedAt",
      -    "licenceUrl"
      -  ],
      -  "type": "object"
      -}
    • changedOutput schema / properties / items / items / required
      Previous value: -[
      -  "itemId",
      -  "contributionExtId",
      -  "textFormat",
      -  "detailLevel",
      -  "contributionUrl",
      -  "source"
      -]New value: +[
      +  "itemId",
      +  "contributionExtId",
      +  "textFormat",
      +  "detailLevel",
      +  "contributionUrl"
      +]
    • addedOutput schema / properties / page / $ref
      Added value: +"#/$defs/Page"
    • removedOutput schema / properties / page / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / page / properties
      Removed value: -{
      -  "hasMore": {
      -    "description": "Further collection items remain.",
      -    "type": "boolean"
      -  },
      -  "nextCursor": {
      -    "description": "Opaque collection continuation; repeat the same filters.",
      -    "type": "string"
      -  },
      -  "returned": {
      -    "description": "Whole items emitted on this page.",
      -    "maximum": 9007199254740991,
      -    "minimum": 0,
      -    "type": "integer"
      -  },
      -  "total": {
      -    "description": "Total supplied by the source or fully read local collection.",
      -    "maximum": 9007199254740991,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -}
    • removedOutput schema / properties / page / required
      Removed value: -[
      -  "returned",
      -  "hasMore"
      -]
    • removedOutput schema / properties / page / type
      Removed value: -"object"
    • changedOutput schema / properties / provenance / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": false,
      -    "description": "Complete official request provenance.",
      -    "properties": {
      -      "api": {
      -        "description": "Official API namespace.",
      -        "enum": [
      -          "bills",
      -          "members",
      -          "commons_votes",
      -          "lords_votes",
      -          "hansard",
      -          "questions",
      -          "committees"
      -        ],
      -        "type": "string"
      -      },
      -      "licenceUrl": {
      -        "description": "Open Parliament Licence HTTPS URL; its exclusions still apply.",
      -        "type": "string"
      -      },
      -      "notices": {
      -        "description": "Source-specific notices.",
      -        "items": {
      -          "description": "Source notice preserved verbatim.",
      -          "type": "string"
      -        },
      -        "type": "array"
      -      },
      -      "retrievedAt": {
      -        "description": "Response retrieval time in ISO 8601 UTC.",
      -        "format": "date-time",
      -        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      -        "type": "string"
      -      },
      -      "url": {
      -        "description": "Actual official HTTPS request URL.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "api",
      -      "url",
      -      "retrievedAt",
      -      "licenceUrl"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "additionalProperties": false,
      -    "description": "Compact provenance with a pointer to the complete request source.",
      -    "properties": {
      -      "api": {
      -        "description": "Official API namespace.",
      -        "enum": [
      -          "bills",
      -          "members",
      -          "commons_votes",
      -          "lords_votes",
      -          "hansard",
      -          "questions",
      -          "committees"
      -        ],
      -        "type": "string"
      -      },
      -      "contentPath": {
      -        "description": "RFC 6901 pointer to full source provenance in the reconstructable payload.",
      -        "type": "string"
      -      },
      -      "licenceUrl": {
      -        "description": "Open Parliament Licence URL.",
      -        "type": "string"
      -      },
      -      "origin": {
      -        "description": "Official origin only; the full request URL is at contentPath.",
      -        "type": "string"
      -      },
      -      "retrievedAt": {
      -        "description": "Response retrieval time.",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "api",
      -      "origin",
      -      "retrievedAt",
      -      "licenceUrl",
      -      "contentPath"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "$ref": "#/$defs/Source",
      +    "description": "Complete official request provenance."
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "Compact provenance with a pointer to the complete request source.",
      +    "properties": {
      +      "api": {
      +        "description": "Official API namespace.",
      +        "enum": [
      +          "bills",
      +          "members",
      +          "commons_votes",
      +          "lords_votes",
      +          "hansard",
      +          "questions",
      +          "committees"
      +        ],
      +        "type": "string"
      +      },
      +      "contentPath": {
      +        "description": "RFC 6901 pointer to full source provenance in the reconstructable payload.",
      +        "type": "string"
      +      },
      +      "licenceUrl": {
      +        "description": "Open Parliament Licence URL.",
      +        "type": "string"
      +      },
      +      "origin": {
      +        "description": "Official origin only; the full request URL is at contentPath.",
      +        "type": "string"
      +      },
      +      "retrievedAt": {
      +        "description": "Response retrieval time.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "api",
      +      "origin",
      +      "retrievedAt",
      +      "licenceUrl",
      +      "contentPath"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedOutput schema / properties / source / $ref
      Added value: +"#/$defs/Source"
    • removedOutput schema / properties / source / additionalProperties
      Removed value: -false
    • removedOutput schema / properties / source / properties
      Removed value: -{
      -  "api": {
      -    "description": "Official API namespace.",
      -    "enum": [
      -      "bills",
      -      "members",
      -      "commons_votes",
      -      "lords_votes",
      -      "hansard",
      -      "questions",
      -      "committees"
      -    ],
      -    "type": "string"
      -  },
      -  "licenceUrl": {
      -    "description": "Open Parliament Licence HTTPS URL; its exclusions still apply.",
      -    "type": "string"
      -  },
      -  "notices": {
      -    "description": "Source-specific notices.",
      -    "items": {
      -      "description": "Source notice preserved verbatim.",
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "retrievedAt": {
      -    "description": "Response retrieval time in ISO 8601 UTC.",
      -    "format": "date-time",
      -    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
      -    "type": "string"
      -  },
      -  "url": {
      -    "description": "Actual official HTTPS request URL.",
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / properties / source / required
      Removed value: -[
      -  "api",
      -  "url",
      -  "retrievedAt",
      -  "licenceUrl"
      -]
    • removedOutput schema / properties / source / type
      Removed value: -"object"
  2. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare this read-only, idempotent and open-world, yet the description adds substantive traits they cannot: newest-sitting-first default ordering, that results contain full source text including HTML while previews are labelled summaries, that a debateSectionId search does not yield an entire debate transcript, and that historical completeness is not guaranteed (including the 2004–2006 gap).

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

Conciseness5/5

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

Front-loaded with purpose and ordering in the first two sentences, then operational caveats (section drill-down, archive gaps, cursor handling, timeout retry) in descending order of importance. Dense but every clause carries distinct information; nothing is restated from the schema.

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

Completeness5/5

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

For a 10-parameter search with an output schema and full schema coverage, the description covers the remaining agent-relevant gaps: result ordering, content format, cursor continuation rules, scoping limits of a section search, and archive completeness caveats. Nothing needed to call it correctly is missing.

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 already 100%, so the baseline is 3; the description still adds real meaning by explaining that sortOrder=SittingDateAsc starts from the oldest sitting, that collection cursors must be followed unchanged, and that contentCursor exists to retrieve losslessly oversized contributions.

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 and resource ('Search spoken Westminster Hansard contributions') and enumerates the filter dimensions (topic, member, House, date, debateSectionId), which is enough to tell it apart from written-record siblings like ukparl_search_questions and ukparl_search_statements without opening a schema.

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

Usage Guidelines4/5

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

Gives concrete when-to guidance: repeat with a returned debateSectionId to drill into a section, consult ukparl_lookup_reference topic=coverage for archive questions, and retry timeouts with shorter date windows. It stops short of stating when to prefer a different search tool, but the spoken-vs-written scoping carries most of that load.

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.