Skip to main content
Glama

uk-parliament-mcp-server

Get constituencies and results

ukparl_get_constituency
Read-onlyIdempotent

Find Westminster constituencies and read a seat's MPs and election results. mode=search (default) matches current seat names or the seats a postcode falls in, or lists all 650 without query; an abolished seat's constituencyId comes from ukparl_get_member roles representations or electionsContested rows. Each boundary set has its own ID (Bath 3895 since 2024, 3308 before). With constituencyId: detail; representations, membership periods with memberId (a member can repeat; member.latestHouseMembership is their latest seat, not this one); election_results, without candidates; election_result, one election with candidates, the latest unless electionId is set. turnout counts valid votes; voteShare is a fraction of 1; candidate memberId is null, winners included, so reach winners through representations. Older seats have partial coverage: an empty list never means no MP or election.

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_get_constituency"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNoOperation; every mode but search requires constituencyId.search
limitNoRows per page: default 10, cap 20; a larger limit returns 20 and says so.
queryNoSearch only: part of a current seat name, or a postcode; omit to list all.
cursorNoCollection continuation; repeat unchanged inputs.
electionIdNoelection_result only; omit for the latest result.
contentCursorNoContinuation for an oversized record.
constituencyIdNoSeat ID for every mode but search.

Output Schema

NameRequiredDescriptionDefault
capNoPage-size ceiling.
modeNoSelected operation.
pageNoCollection continuation.
errorNoPresent when the call failed. Absent on success.
foundNoFalse when constituencyId names no seat.
shownNoRows on this page.
noticeNoLicence, field-meaning and limit notices.
sourceNoSelected official request.
appliedNoEffective operation and page size.
deliveryNoFull selected payload, child outline, or JSON fragment.
guidanceNoRecovery when a seat, election or row is missing.
identityNoStable selected-record identifiers retained during content retrieval.
retrievalNoSame-tool retrieval instruction.
truncatedNoMore rows remain.
provenanceNoSelected response provenance retained during content retrieval; source notices remain in the reconstructed payload.
resultTypeNoSource match basis as sent: Constituency, FullPostcode, PartialPostcode, Other (no query) or None.
contentPageNoLossless recursive content continuation.
constituencyNoThe seat; parent of any rows.
collectionPageNoCollection continuation; reconstruct the outlined selected payload before following it.
constituenciesNoMatching current seats.
electionResultNoOne election and its candidates.
electionResultsNoElections, without candidates.
representationsNoMembership periods, newest first.
constituencySourceNoRequest for constituency outside detail.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

With readOnly/openWorld/idempotent already declared, the description adds real behavioral caveats: boundary sets have distinct IDs (Bath 3895 vs 3308), a member can repeat across representations, member.latestHouseMembership is not necessarily this seat, candidate memberId is null so winners must be reached via representations, and older seats have partial coverage so "an empty list never means no MP or election." That is substantive disclosure an agent could not infer from 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?

Purpose is front-loaded and nearly every clause carries information, but the body is a dense semicolon-chained block that is harder to scan than it needs to be for five distinct modes. Slight tightening into mode-by-mode lines would improve it without losing content.

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 multi-mode, seven-parameter tool with an output schema, the description covers mode selection, ID sourcing, pagination expectations, result shape at a high level, and data-quality caveats. Nothing an agent needs in order to pick a mode and call it correctly appears to be 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 100%, so the baseline is 3, but the description goes further: it defines electionId as overriding the latest result, explains constituencyId's per-boundary-set values, and defines turnout (valid votes) and voteShare (fraction of 1). The only gap is that limit/cursor/contentCursor behavior is left almost entirely to the schema text.

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 specific verbs and resources up front ("Find Westminster constituencies and read a seat's MPs and election results") and then enumerates what each mode returns (detail, representations, election_results, election_result). An agent can distinguish this from ukparl_get_member and the search_* siblings 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 Guidelines5/5

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

Explicitly says mode=search is the default and what it matches (current names, postcode, or all 650 when query is omitted), and that every other mode requires constituencyId. It also routes the agent elsewhere for an abolished seat's ID ("comes from ukparl_get_member roles representations or electionsContested rows"), which is exactly the when/when-not guidance the dimension asks for.

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.