search_parliament_speeches
Retrieve parliamentary debate speeches and speaker details for specific Swiss affairs to analyze legislative discussions and contributions.
Instructions
Get debate speeches and contributions for a specific parliamentary affair. Returns speaker info and speech details.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| affair_id | Yes | OpenParlData affair ID (get from search_parliament_business results) | |
| limit | No | Max speeches to return (default: 5, max: 20) |
Implementation Reference
- src/modules/parliament.ts:464-499 (handler)The handler function 'searchParliamentSpeeches' that fetches speeches for a parliamentary affair from the OpenParlData API.
async function searchParliamentSpeeches(args: { affair_id: number; limit?: number; }): Promise<string> { const limit = Math.min(args.limit ?? 5, 20); const url = buildUrl(`/affairs/${args.affair_id}/speeches`, { lang: "de", lang_format: "flat", limit, }); const resp = await apiFetch<SpeechRecord>(url); const speeches = resp.data.map((s) => ({ id: s.id, speaker: s.person_fullname, personId: s.person_id, party: s.party_de, type: s.speech_type_de, text: s.text_de ? s.text_de.length > 500 ? s.text_de.slice(0, 500) + "…" : s.text_de : null, time: s.begin_time, durationSeconds: s.duration_seconds, })); return truncate( JSON.stringify({ count: speeches.length, total: resp.meta.total_records, affairId: args.affair_id, speeches, }) ); } - src/modules/parliament.ts:133-152 (schema)Tool schema definition for 'search_parliament_speeches' defining input properties such as affair_id and limit.
{ name: "search_parliament_speeches", description: "Get debate speeches and contributions for a specific parliamentary affair. Returns speaker info and speech details.", inputSchema: { type: "object" as const, required: ["affair_id"], properties: { affair_id: { type: "number", description: "OpenParlData affair ID (get from search_parliament_business results)", }, limit: { type: "number", description: "Max speeches to return (default: 5, max: 20)", }, }, }, },