Skip to main content
Glama

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
NameRequiredDescriptionDefault
limitNoNumber of sessions to return (default: 5, max: 20)

Implementation Reference

  • 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,
        })
      );
    }
  • 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)",
          },
        },
      },
    },
  • Registration/dispatch logic for get_session_schedule in the main handler function.
    case "get_session_schedule":
      return getSessionSchedule(args as { limit?: number });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vikramgorla/mcp-swiss'

If you have feedback or need assistance with the MCP directory API, please join our Discord server