Skip to main content
Glama

search_cantonal_affairs

Search political affairs across all 26 Swiss cantonal parliaments using OpenParlData. Find parliamentary discussions by canton and topic.

Instructions

Search political affairs across Swiss cantonal parliaments (Kantonsräte). Covers all 26 cantons via OpenParlData.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cantonYesCanton abbreviation: ZH, BE, LU, UR, SZ, OW, NW, GL, ZG, FR, SO, BS, BL, SH, AR, AI, SG, GR, AG, TG, TI, VD, VS, NE, GE, JU
queryNoSearch term (optional, e.g. 'Bildung', 'Verkehr')
limitNoMax results (default: 5, max: 20)

Implementation Reference

  • The searchCantonalAffairs function handles the logic for searching cantonal parliamentary affairs using the OpenParlData API.
    async function searchCantonalAffairs(args: {
      canton: string;
      query?: string;
      limit?: number;
    }): Promise<string> {
      const limit = Math.min(args.limit ?? 5, 20);
      const params: Record<string, string | number | boolean | undefined> = {
        body_key: args.canton.toUpperCase(),
        lang: "de",
        lang_format: "flat",
        sort_by: "-begin_date",
        limit,
      };
      if (args.query) {
        params.search = args.query;
      }
    
      const url = buildUrl("/affairs/", params);
      const resp = await apiFetch<AffairRecord>(url);
    
      const affairs = resp.data.map((a) => ({
        id: a.id,
        number: a.number,
        title: a.title_de,
        type: a.type_name_de,
        typeCategory: a.type_harmonized_de,
        status: a.state_name_de,
        date: a.begin_date ? a.begin_date.split("T")[0] : null,
        canton: a.body_key,
        url: a.url_external_de,
      }));
    
      return truncate(
        JSON.stringify({
          count: affairs.length,
          total: resp.meta.total_records,
          canton: args.canton.toUpperCase(),
          query: args.query || null,
          affairs,
        })
      );
    }
  • The input schema definition for the search_cantonal_affairs tool.
    {
      name: "search_cantonal_affairs",
      description:
        "Search political affairs across Swiss cantonal parliaments (Kantonsräte). Covers all 26 cantons via OpenParlData.",
      inputSchema: {
        type: "object" as const,
        required: ["canton"],
        properties: {
          canton: {
            type: "string",
            description:
              "Canton abbreviation: ZH, BE, LU, UR, SZ, OW, NW, GL, ZG, FR, SO, BS, BL, SH, AR, AI, SG, GR, AG, TG, TI, VD, VS, NE, GE, JU",
          },
          query: {
            type: "string",
            description: "Search term (optional, e.g. 'Bildung', 'Verkehr')",
          },
          limit: {
            type: "number",
            description: "Max results (default: 5, max: 20)",
          },
        },
      },
    },
  • The tool registration and invocation dispatcher in handleParliament.
    case "search_cantonal_affairs":
      return searchCantonalAffairs(
        args as { canton: string; query?: string; 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 but offers minimal behavioral insight. It mentions the data source (OpenParlData) but doesn't cover permissions, rate limits, pagination, error handling, or what the search returns (e.g., list of affairs with details). For a search tool with zero annotation coverage, this is inadequate.

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 a single, efficient sentence that front-loads the core purpose. It avoids redundancy and wastes no words, though it could be slightly more informative without losing conciseness.

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?

Given the tool's complexity (search across 26 cantons), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what constitutes a 'political affair', the format of results, or any limitations (e.g., date ranges, availability). This leaves significant gaps for an agent to use the tool effectively.

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 fully documents parameters. The description adds no parameter-specific information beyond implying a search across cantons, which is already clear from the schema's canton field. Baseline 3 is appropriate when the schema does the heavy lifting.

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 searches political affairs across Swiss cantonal parliaments, specifying the scope (all 26 cantons) and data source (OpenParlData). It distinguishes from siblings by focusing on cantonal affairs rather than federal or other domains, though it doesn't explicitly contrast with similar tools like search_parliament_business.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, typical use cases, or how it differs from sibling tools like search_parliament_business or search_votes, leaving the agent to infer usage context.

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