Skip to main content
Glama

get_parliamentary_documents

Retrieve official parliamentary documents including reports, committee opinions, and federal council statements for Swiss legislative affairs using OpenParlData affair IDs.

Instructions

Get official documents for a parliamentary affair — reports, committee opinions, federal council statements.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
affair_idYesOpenParlData affair ID (get from search_parliament_business results)
limitNoMax documents to return (default: 5, max: 20)

Implementation Reference

  • The handler function that fetches parliamentary documents for a given affair_id from the OpenParlData API.
    async function getParliamentaryDocuments(args: {
      affair_id: number;
      limit?: number;
    }): Promise<string> {
      const limit = Math.min(args.limit ?? 5, 20);
      const url = buildUrl(`/affairs/${args.affair_id}/docs`, {
        lang: "de",
        lang_format: "flat",
        limit,
      });
      const resp = await apiFetch<DocRecord>(url);
    
      const docs = resp.data.map((d) => ({
        id: d.id,
        title: d.title_de,
        type: d.type_de,
        url: d.url_external,
        filename: d.filename,
        date: d.date ? d.date.split("T")[0] : null,
      }));
    
      return truncate(
        JSON.stringify({
          count: docs.length,
          total: resp.meta.total_records,
          affairId: args.affair_id,
          documents: docs,
        })
      );
    }
  • The tool definition and input schema for get_parliamentary_documents.
      name: "get_parliamentary_documents",
      description:
        "Get official documents for a parliamentary affair — reports, committee opinions, federal council statements.",
      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 documents to return (default: 5, max: 20)",
          },
        },
      },
    },
  • Registration in the main dispatcher for the get_parliamentary_documents tool.
    case "get_parliamentary_documents":
      return getParliamentaryDocuments(
        args as { affair_id: number; 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