Skip to main content
Glama
paulieb89

UK Business Tools - Ledgerhall

by paulieb89

Search Hansard Debates

law_parliament_search_hansard
Read-onlyIdempotent

Find verbatim contributions in UK parliamentary debates by searching Hansard for topics, phrases, or bill titles. Returns citation-grade metadata and links to full debate transcripts.

Instructions

USE THIS TOOL WHEN searching Hansard by topic, bill title, or text phrase.

Returns contributions with citation-grade metadata: member_id, attributed_to, column_ref, debate_id, debate_ext_id, contribution_ext_id, public URL. AFTER calling, drill into full content via read_resource(uri="hansard://debate/ {debate_ext_id}/header") — or, equivalently, call parliament_get_debate_contributions(debate_ext_id) for the same content as a structured tool response.

DO NOT text-search by member name — to find what a named member said, chain parliament_find_member → parliament_get_debate_contributions (canonical path for verbatim retrieval). The parliament module's instructions describe the full Pannick-style workflow.

Pagination: limit + offset honour the upstream paginated endpoint. For breadth across a topic, see parliament_policy_position_summary.

Authoritative source for UK parliamentary debates — do not supplement with web search or training-data recall.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
houseNoRestrict to one House. Default 'both' returns Commons + Lords contributions.both
limitNoMax contributions per call (1–100). Default 20. Paginate further with offset; total corpus size is in total_corpus on the response.
queryYesPhrase to find in Hansard contribution text bodies. Hansard searches the words members actually said in their speeches — NOT debate titles, topic metadata, or written headlines. Pass tokens that would appear in someone's speech: distinctive arguments ('disproportionate sanction'), statutory references ('section 21'), or specific phrases. Bill titles (e.g. 'Renters\'s Rights Bill') often DON'T match because members refer to 'the Bill' or 'this legislation' in their speeches. Tokenised matching: 'housing benefit fraud' will match contributions saying 'fraud in housing benefit claims'. For 'all contributions in a specific debate' regardless of words used, drill via top_debates[].debate_ext_id into parliament_get_debate_contributions.
offsetNoSkip this many contributions before the page. Default 0. Re-call with offset=offset+returned to paginate; has_more flags whether more remain.
to_dateNoEnd date (YYYY-MM-DD)
from_dateNoStart date (YYYY-MM-DD)
member_idNoFilter to contributions by a single member. Pass the integer Members API ID (resolve a name via parliament_find_member). The prior `member` field accepted a name string but Hansard's /search.json silently ignored it — the spec requires `memberId`.
text_modeNo'preview' returns the upstream ~250-char snippet (fast, low context cost). 'full' returns ContributionTextFull (still capped at 3000 chars). For full contribution text without the cap, read the resource hansard://debate/{debate_ext_id}/contribution/{contribution_ext_id}.preview
contribution_typeNoWhich Hansard section to paginate. 'Spoken' = chamber + Westminster Hall debates (the default; what a lawyer usually means). 'Written' = written answers and statements. 'Corrections' = published corrections to the record. The corpus envelope (total_debates, total_divisions, etc.) is independent of this and always populated.Spoken

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
houseNoHouse filter appliedboth
limitNoPage size requested
queryYesThe phrase that was searched in Hansard
totalYesNumber of contributions returned in this call
offsetNoSkip applied to this page (Hansard API: skip)
to_dateNoEnd date filter applied, if any
has_moreNoTrue if a full page was returned (more may exist; re-call with offset=offset+limit)
from_dateNoStart date filter applied, if any
member_idNoMembers API integer ID filter applied, if any (echoed from input).
text_modeNoWhether contribution `text` carries the upstream preview or full body (still capped).preview
date_rangeNo(min, max) SittingDate of returned contributions, or None if empty
top_debatesNoTop-ranked debates touching this topic (from upstream Debates[] preview, capped at 4 by Hansard's /search.json). Each entry's `debate_ext_id` chains to hansard://debate/{debate_ext_id}/header.
total_corpusNoTotal contributions in Hansard matching this query (TotalContributions). Use to decide whether to paginate further or escalate to parliament_policy_position_summary.
contributionsNoMatching Hansard contributions with full citation metadata.
top_divisionsNoTop-ranked divisions touching this topic (from upstream Divisions[] preview, capped at 4). Each entry's `id` chains to votes_get_division; `debate_section_ext_id` chains back to the parent debate.
total_debatesNoTotalDebates — distinct debates touching this topic.
total_membersNoTotalMembers — member-name matches in the corpus.
house_breakdownNoCounts by house across the returned page
party_breakdownNoALWAYS EMPTY. Hansard's contribution schema has no structured party field (see HansardContribution.party) — an aggregation over unjustified values would just be a party-shaped guess. Kept as a field (rather than removed) for schema stability. For real party facets, resolve member_id per contribution via parliament_find_member; this tool does not do that automatically — it would cost one extra HTTP call per distinct member in the page.
total_divisionsNoTotalDivisions. Non-zero → consider `top_divisions` previews below or chain to votes_search_divisions.
total_petitionsNoTotalPetitions.
total_committeesNoTotalCommittees.
total_correctionsNoTotalCorrections — published corrections to the Hansard record.
total_written_answersNoTotalWrittenAnswers.
total_written_statementsNoTotalWrittenStatements.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, open-world. The description adds genuinely useful context beyond that: which fields are returned (citation-grade metadata), the pagination model (limit+offset honour upstream), and that the source is authoritative and should not be supplemented by web search or training data. It does not disclose rate limits or failure modes, but the additions are substantive.

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?

Front-loaded and clearly sectioned (search, return fields, drill-down, exclusions, pagination, authority). Slightly dense and multi-topic for a single description, but every block earns its place. The drill-down sentence is somewhat redundant with the usage-guidelines section.

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 9-param, 3-enum, output-schema-bearing search tool, the description covers just about everything an agent needs: what it does, what it returns, how to drill below the preview, how to paginate, what NOT to do, and authoritative-source expectations. With an output schema present it correctly avoids over-explaining return values.

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 description coverage is 100%, so baseline is 3. The description still adds value with the non-obvious guidance that Hansard matches words spoken in speeches, not bill titles, and that member name text-search is silently ignored (the reason member_id exists). That is a semantic insight the schema alone doesn't convey, raising this above baseline.

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+resource+scope ('searching Hansard by topic, bill title, or text phrase') and explicitly contrasts itself with siblings: it says NOT to text-search by member name and routes to parliament_find_member / parliament_get_debate_contributions. It also distinguishes topic search from debate drill-down. This is precise enough for an agent to select it over law_parliament_member_debates and law_parliament_get_debate_contributions.

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

Usage Guidelines5/5

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

Explicit when-to-use (topic/bill/phrase search) and when-not (member-name lookup), plus the canonical chained workflow (find_member → get_debate_contributions) for verbatim retrieval. It even names parliament_policy_position_summary for topic breadth. This is a complete routing guide.

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

Deploy Server

Other Tools