hansard_stats

Answers questions whose answer is a number: how many speeches, how many words, over which days, grouped by speaker, portfolio, chamber, debate, month, parliament or kind. Returns aggregates only, never speech text. Use it instead of paging search_hansard.

FactValue
Toolhansard_stats
Partner scope requiredhansard:read
Subscriber tier requiredAI Pro
Accepts as_atno

Parameters

NameTypeRequiredDefault
group_byarray of stringyes
metricsarray of stringnonull
querystringnonull
speakersarray of stringnonull
portfoliosarray of stringnonull
chambersarray of stringnonull
topicsarray of stringnonull
parliament_numberintegernonull
aao_register_idstringnonull
date_fromstringnonull
date_tostringnonull
ministers_onlybooleannofalse
order_bystringnonull
top_nintegernonull
limitintegerno50
offsetintegerno0
cursorstringnonull

Notes

Request (hansard_stats with {"group_by":["chamber"],"metrics":["speech_count","total_words"],"date_from":"2025-07-01","date_to":"2026-06-30"})

Python SDK

import asyncio, os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async def main():
    headers = {"Authorization": f"Bearer {os.environ['LAWATLAS_API_KEY']}"}
    async with streamablehttp_client("https://advisor.lawatlas.ai/api/mcp-http/mcp", headers=headers) as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()
            result = await session.call_tool("hansard_stats", {
                "group_by": [
                    "chamber"
                ],
                "metrics": [
                    "speech_count",
                    "total_words"
                ],
                "date_from": "2025-07-01",
                "date_to": "2026-06-30"
            })
            print(result.content[0].text)

asyncio.run(main())

curl

curl -s https://advisor.lawatlas.ai/api/mcp-http/mcp \
  -H "Authorization: Bearer $LAWATLAS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"hansard_stats","arguments":{"group_by":["chamber"],"metrics":["speech_count","total_words"],"date_from":"2025-07-01","date_to":"2026-06-30"}}}'

Response, as Advisor returned it on 10 October 2026. The tool's result is the JSON text of result.content[0].text; lists and long text are trimmed where marked "...".

{
  "schema_version": "3.5",
  "result": [
    {
      "group": {
        "chamber": "senate"
      },
      "speech_count": 18239,
      "total_words": 3557477
    },
    {
      "group": {
        "chamber": "hofreps"
      },
      "speech_count": 17538,
      "total_words": 6969248
    }
  ],
  "page": {
    "returned": 2,
    "total": 2,
    "next_cursor": null,
    "truncated": false,
    "limit_requested": 50,
    "limit_applied": 50
  },
  "group_by": [
    "chamber"
  ],
  "source": "Parliamentary Debates (Hansard), Parliament of Australia",
  "disclosure": "Speaker portfolio is the portfolio held on the date of the speech, under the Administrative Arrangements Order in force that day. It indicates that the speaker was a minister in that portfolio.",
  "corpus": {
    "corpus_through": "2026-09-16",
    "corpus_ingested_at": "2026-09-16T09:54:45+00:00"
  },
  "notes": [
    "A 'speech' is one Hansard contribution. A one-line interjection and a 3,570-word second-reading speech each count as one - 29.6% of the corpus is interjections. speech_count is not a measure of how much someone spoke; use total_words for that, or group_by=['kind'] to separate them.",
    "word_count includes material incorporated into Hansard by leave, which is not spoken. The corpus carries no flag distinguishing it, so word totals are an upper bound: one 6,551-word contribution in June 2026 is seven written government responses to committee reports."
  ],
  "usage": "Aggregate counts only - no speech text. Pass the same filters to search_hansard to read the speeches behind any number. `total` counts groups, not speeches."
}

Note: Hansard passages come with conditions of use, and your service must keep them.

  • Verbatim. Reproduce a passage unaltered. Analysis around a quotation is fine; rewriting the quotation is not.
  • Attributed. Attribute each passage to "Parliamentary Debates (Hansard), Parliament of Australia" and show the reader the official_record link.
  • Not fetched. Show the official_record link, do not fetch it: aph.gov.au refuses automated requests.
  • Not the official record. Advisor is a search over the record, not the record. Label your service the same way.
  • Not for satire, ridicule or political advertising, or to misrepresent any Senator or Member.

Errors

CodeMeaningWhat to do
INVALID_ARGUMENTA group_by, metrics or filter value is unknownUse a value from the list in the message, or from list_hansard_filters
TERMS_REQUIREDA partner organisation has not accepted the Hansard conditionsAccept them on the partner page

Related tools