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 }
      );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool retrieves but lacks critical behavioral details: whether this is a read-only operation, if there are rate limits, authentication requirements, pagination behavior, or what happens when no documents exist. The description is minimal and doesn't compensate for missing annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with a single sentence that efficiently communicates the core purpose. It's front-loaded with the main action and includes specific document types without unnecessary elaboration. However, it could be slightly more structured by separating purpose from parameter context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format documents are returned in, whether they include metadata, how errors are handled, or any limitations beyond the implied limit parameter. The description leaves too many behavioral questions unanswered given the lack of structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing good documentation for both parameters. The description adds no additional parameter semantics beyond what the schema already explains about affair_id and limit. This meets the baseline score of 3 when schema coverage is high, but doesn't enhance understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('official documents for a parliamentary affair'), including document types like reports and committee opinions. It distinguishes from most siblings by focusing on parliamentary documents, though it doesn't explicitly differentiate from similar tools like get_parliament_votes or get_parliament_members.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing parliamentary documents, but provides no explicit guidance on when to use this tool versus alternatives like get_parliament_votes or search_parliament_business. It mentions the affair_id parameter comes from search_parliament_business results, which offers some contextual hint but not clear usage rules.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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