Skip to main content
Glama

canada-parliament-mcp-server

Canparl Get Bill Text

canparl_get_bill_text
Read-onlyIdempotent

Read one version of a House or Senate bill as plain text from its official XML: the introduction (recommendation, summary, preamble, enacting clause), headings, numbered body sections, and schedules. Omitted publicationId reads the last-listed version in canparl_get_bill publications; omitted session means the verified current official session. Text over 24000 bytes returns an outline of segment counts and the outermost headings, each with its body offset and count; re-call with one segment and follow pagination.nextOffset. Sections are never split. A version exported only as a PDF, as in many older sessions, has no text here.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "billCode": "<billCode>"
    },
    "name": "canparl_get_bill_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoWhole records per page of segment headings, body, or schedules: default 50 headings or 5 sections or schedules, 1–100 per call; larger values up to 10000 return 100 with a notice.
offsetNoZero-based whole-record offset in segment headings, body, or schedules, default 0; a heading's offset is the body offset of its first section.
segmentNoOne segment: introduction, headings, body, schedules. Omit for the whole text, or its outline above the 24000-byte threshold.
sessionNoParliamentary session; omitted means current.
billCodeYesBill code from canparl_search_bills, including a split-bill suffix letter such as C-15A; accepts bill s321, S321, S 321, or S-321.
languageNoText language: en (default) reads the English XML, fr the French.en
publicationIdNoPublication ID from canparl_get_bill publications; omit for the last-listed (furthest-stage) version.

Output Schema

NameRequiredDescriptionDefault
billNoOfficial bill summary, as canparl_search_bills returns it.
bodyNoTop-level body sections in document order.
kindNoAbsent for the whole text; outline lists segments; segment returns one selection.
errorNoPresent when the call failed. Absent on success.
noticeNoLimit clamp guidance when applicable.
headingsNoBody headings of every level in document order; an outline lists only the outermost level.
segmentsNoSegment selectors with their record counts; outline only.
schedulesNoTop-level schedules in document order.
disclosureNoOutline, empty-segment, or past-end guidance.
paginationNoWhole-record continuation of a headings, body, or schedules page.
provenanceNoOriginal retrieval metadata for every source request.
totalCountNoRecords in the selected headings, body, or schedules segment; paged segments only.
publicationNoThe version read: its dossier publication record and the identity its XML prints.
introductionNoText before the body as plain text; the table of provisions is left to the outline and headings.
appliedFiltersNoNormalized requested bill version.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_text_segment`: offset or limit supplied without segment headings, body, or schedules. `unknown_publication`: publicationId is not one of the bill's publications. `bill_text_unavailable`: The bill lists no publications, or the version has no XML text: a PDF-only or table-of-contents export, a missing viewer page, or a missing XML file. `unknown_session`: Session with a zero or out-of-range number, or absent from the official bill session index. `bill_not_found`: Official dossier has no matching record or returns a missing-record response. `upstream_blocked`: An official parliamentary source refuses the request with HTTP 403. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `bill_text_timeout`: The official document viewer or its bill XML exceeds the remaining upstream time budget. `invalid_text_segment`: offset or limit supplied without segment headings, body, or schedules. `unknown_publication`: publicationId is not one of the bill's publications. `bill_text_unavailable`: The bill lists no publications, or the version has no XML text: a PDF-only or table-of-contents export, a missing viewer page, or a missing XML file. `unknown_session`: Session with a zero or out-of-range number, or absent from the official bill session index. `bill_not_found`: Official dossier has no matching record or returns a missing-record response. `upstream_blocked`: An official parliamentary source refuses the request with HTTP 403. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_text_segment",
      -  "unknown_publication",
      -  "bill_text_unavailable",
      -  "unknown_session",
      -  "bill_not_found",
      -  "upstream_blocked"
      -]New value: +[
      +  "bill_text_timeout",
      +  "invalid_text_segment",
      +  "unknown_publication",
      +  "bill_text_unavailable",
      +  "unknown_session",
      +  "bill_not_found",
      +  "upstream_blocked"
      +]
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the readOnly, openWorld, and idempotent annotations, the description discloses significant behavior: the 24000-byte outline threshold, segment-based re-calling, pagination via nextOffset, and that sections are never split. It also states the important limitation that versions exported only as PDFs have no text, which is exactly the kind of runtime behavior an agent needs to anticipate.

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?

The description is front-loaded with the core action and is appropriately sized for a tool with complex pagination and segment behavior. It is dense and uses long semicolon-linked sentences, but almost every clause conveys operational information rather than filler.

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?

Given the rich input schema, available annotations, and the presence of an output schema, the description covers the key gaps: segmentation, the outline threshold, pagination, default version selection, and the PDF-only limitation. An agent has enough information to call the tool correctly and interpret the major response modes.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already explains all seven parameters, including defaults, limits, and patterns. The description reinforces defaults for publicationId and session and adds a little navigation guidance for segments and pagination, but most parameter meaning is carried by the schema rather than the description.

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?

The description states a specific verb and resource: reading one version of a House or Senate bill as plain text from official XML. It enumerates the extracted components (introduction, headings, body sections, schedules) and distinguishes this from fetching bill metadata by naming canparl_get_bill publications as the source of publicationId.

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?

It gives useful operational context: omit publicationId for the last-listed version, omit session for the current official session, and re-call with a segment when the response is an outline. It also warns that PDF-only versions have no text here, but it does not explicitly say when to use this tool instead of canparl_get_bill or which alternative to use for PDF-only versions.

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.