Skip to main content
Glama

get_parliament_votes

Retrieve voting results for Swiss parliamentary affairs using OpenParlData. Enter an affair ID to access all recorded votes for specific legislative matters.

Instructions

Get voting results for a specific parliamentary affair (Geschäft). Returns all recorded votes for the given affair ID from OpenParlData.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
affair_idYesOpenParlData affair ID (get from search_parliament_business results)

Implementation Reference

  • The getParliamentVotes function implements the business logic for retrieving parliamentary vote records for a given affair_id.
    async function getParliamentVotes(args: {
      affair_id: number;
    }): Promise<string> {
      const url = buildUrl(`/affairs/${args.affair_id}/votings`, {
        lang: "de",
        lang_format: "flat",
      });
      const resp = await apiFetch<VotingRecord>(url);
    
      const votes = resp.data.map((v) => ({
        id: v.id,
        affairId: v.affair_id,
        subject: v.subject_de,
        meaningYes: v.meaning_yes_de,
        meaningNo: v.meaning_no_de,
        yes: v.total_yes,
        no: v.total_no,
        abstain: v.total_abstain,
        absent: v.total_absent,
        date: v.vote_date ? v.vote_date.split("T")[0] : null,
      }));
    
      return truncate(
        JSON.stringify({
          count: votes.length,
          affairId: args.affair_id,
          votes,
        })
      );
    }
  • Tool definition and input schema registration for get_parliament_votes.
    name: "get_parliament_votes",
    description:
      "Get voting results for a specific parliamentary affair (Geschäft). Returns all recorded votes for the given affair ID from OpenParlData.",
    inputSchema: {
      type: "object" as const,
      required: ["affair_id"],
      properties: {
        affair_id: {
          type: "number",
          description:
            "OpenParlData affair ID (get from search_parliament_business results)",
        },
      },
    },
  • Request handling switch case that dispatches calls to get_parliament_votes to the implementation function.
    case "get_parliament_votes":
      return getParliamentVotes(args as { affair_id: number });
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the operation is a read (implied by 'Get'), specifies the data source, and indicates it returns 'all recorded votes', which adds useful context. However, it lacks details on rate limits, error conditions, or response format, leaving behavioral gaps.

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

Conciseness5/5

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

Two sentences with zero waste: the first states purpose and resource, the second specifies return scope and data source. It's front-loaded and efficiently structured, with every sentence earning its place.

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

Completeness4/5

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

For a single-parameter read tool with no annotations and no output schema, the description is reasonably complete: it covers purpose, usage context, and behavioral aspects like data source. However, it could improve by detailing output format or error handling, given the lack of structured fields.

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%, so the schema already documents the 'affair_id' parameter fully. The description adds minimal value beyond the schema by referencing 'OpenParlData' and 'search_parliament_business', but doesn't provide additional syntax or format details. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose5/5

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

The description clearly states the verb ('Get') and resource ('voting results for a specific parliamentary affair'), specifying it returns 'all recorded votes for the given affair ID'. It distinguishes from siblings like 'get_voting_results' by specifying the data source (OpenParlData) and scope (affair-specific).

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

Usage Guidelines4/5

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

It provides clear context by mentioning the data source (OpenParlData) and referencing 'search_parliament_business' as the way to obtain affair IDs. However, it doesn't explicitly state when not to use this tool or name alternatives among siblings like 'get_vote_details' or 'search_votes'.

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