get_session_schedule
Retrieve upcoming and recent Swiss parliament session schedules, including session names, dates, and types, to track legislative activities.
Instructions
Get upcoming and recent Swiss parliament sessions (Sessionen). Shows session names, dates and types.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of sessions to return (default: 5, max: 20) |
Implementation Reference
- src/modules/parliament.ts:419-450 (handler)Implementation of the get_session_schedule tool, which fetches parliamentary session data from OpenParlData.
async function getSessionSchedule(args: { limit?: number; }): Promise<string> { const limit = Math.min(args.limit ?? 5, 20); const url = buildUrl("/meetings/", { body_key: "CHE", type: "session", sort_by: "-begin_date", lang: "de", lang_format: "flat", limit, }); const resp = await apiFetch<MeetingRecord>(url); const sessions = resp.data.map((m) => ({ id: m.id, name: m.name_de, abbreviation: m.abbreviation, type: m.type_external_de, startDate: m.begin_date ? m.begin_date.split("T")[0] : null, endDate: m.end_date ? m.end_date.split("T")[0] : null, url: m.url_external_de, })); return truncate( JSON.stringify({ count: sessions.length, total: resp.meta.total_records, sessions, }) ); } - src/modules/parliament.ts:120-132 (schema)Definition of the get_session_schedule tool schema.
name: "get_session_schedule", description: "Get upcoming and recent Swiss parliament sessions (Sessionen). Shows session names, dates and types.", inputSchema: { type: "object" as const, properties: { limit: { type: "number", description: "Number of sessions to return (default: 5, max: 20)", }, }, }, }, - src/modules/parliament.ts:686-687 (registration)Registration/dispatch logic for get_session_schedule in the main handler function.
case "get_session_schedule": return getSessionSchedule(args as { limit?: number });