Skip to main content
Glama
Hug0x0

mcp-reunion

reunion_get_european_2024

Retrieve final aggregated results of the 2024 European Parliament elections for La Réunion, including voting stats and list details.

Instructions

Final results of the European Parliament elections held on June 9, 2024 (single round) aggregated for département 974 (La Réunion). France elects 81 MEPs from a single national constituency, but this dataset shows how Réunion voters behaved as a department. Returns base voting stats (registered, voters, abstentions, blank, null, expressed) and an array of all 38 lists with panel number, political nuance, list name and abbreviated name, vote count, % of registered/expressed, seats won (national-level allocation reflected here). Sorted by vote count descending.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for reunion_get_european_2024 tool. Queries data.gouv.fr tabular API for European 2024 election results filtered to département 974, returns base voting stats (registered, voters, abstentions, blank, null, expressed) plus an array of 38 lists sorted by vote count descending.
    server.tool(
      'reunion_get_european_2024',
      'Final results of the European Parliament elections held on June 9, 2024 (single round) aggregated for département 974 (La Réunion). France elects 81 MEPs from a single national constituency, but this dataset shows how Réunion voters behaved as a department. Returns base voting stats (registered, voters, abstentions, blank, null, expressed) and an array of all 38 lists with panel number, political nuance, list name and abbreviated name, vote count, % of registered/expressed, seats won (national-level allocation reflected here). Sorted by vote count descending.',
      {},
      async () => {
        try {
          const data = await dataGouvClient.query<Row>(RES_EUROP_2024_DEPT, {
            filters: { 'Code département': '974' },
            pageSize: 5,
          });
          const row = data.data[0];
          if (!row) {
            return errorResult('No data returned for département 974 in European 2024 dataset');
          }
          return jsonResult({
            source: 'data.gouv.fr (Ministère de l\'Intérieur)',
            election: 'européennes 2024',
            department: str(row['Libellé département']),
            ...mapBaseStats(row),
            lists: meltLists(row),
          });
        } catch (error) {
          return errorResult(error instanceof Error ? error.message : 'Failed to fetch European 2024');
        }
      }
    );
  • Registration of the reunion_get_european_2024 tool via server.tool() inside registerNationalElectionsTools().
    server.tool(
      'reunion_get_european_2024',
      'Final results of the European Parliament elections held on June 9, 2024 (single round) aggregated for département 974 (La Réunion). France elects 81 MEPs from a single national constituency, but this dataset shows how Réunion voters behaved as a department. Returns base voting stats (registered, voters, abstentions, blank, null, expressed) and an array of all 38 lists with panel number, political nuance, list name and abbreviated name, vote count, % of registered/expressed, seats won (national-level allocation reflected here). Sorted by vote count descending.',
      {},
      async () => {
        try {
          const data = await dataGouvClient.query<Row>(RES_EUROP_2024_DEPT, {
            filters: { 'Code département': '974' },
            pageSize: 5,
          });
          const row = data.data[0];
          if (!row) {
            return errorResult('No data returned for département 974 in European 2024 dataset');
          }
          return jsonResult({
            source: 'data.gouv.fr (Ministère de l\'Intérieur)',
            election: 'européennes 2024',
            department: str(row['Libellé département']),
            ...mapBaseStats(row),
            lists: meltLists(row),
          });
        } catch (error) {
          return errorResult(error instanceof Error ? error.message : 'Failed to fetch European 2024');
        }
      }
    );
  • Tool module registration entry point — registerNationalElectionsTools is called from registerAllTools.
      registerNationalElectionsTools(server);
      registerPossessionTools(server);
      registerSocialTools(server);
      registerTelecomTools(server);
      registerTerritoryTools(server);
      registerTourismTools(server);
      registerTransportTools(server);
      registerUrbanismTools(server);
      registerWeatherTools(server);
    }
  • meltLists helper — extracts up to 38 list entries from the wide-format row into a clean array sorted by vote count.
    function meltLists(row: Row, maxN = 38) {
      const out = [];
      for (let i = 1; i <= maxN; i++) {
        const name = str(row[`Libellé de liste ${i}`]);
        if (!name) continue;
        out.push({
          panel: num(row[`Numéro de panneau ${i}`]),
          nuance: str(row[`Nuance liste ${i}`]),
          list_name: name,
          list_short: str(row[`Libellé abrégé de liste ${i}`]),
          votes: num(row[`Voix ${i}`]),
          pct_registered: str(row[`% Voix/inscrits ${i}`]),
          pct_expressed: str(row[`% Voix/exprimés ${i}`]),
          seats: num(row[`Sièges ${i}`]),
        });
      }
      return out.sort((a, b) => (b.votes ?? 0) - (a.votes ?? 0));
    }
  • mapBaseStats helper — extracts base voting statistics (registered, voters, abstentions, blank, null, expressed) from the raw row.
    function mapBaseStats(row: Row) {
      return {
        registered: num(row.Inscrits),
        voters: num(row.Votants),
        pct_voters: str(row['% Votants']),
        abstentions: num(row.Abstentions),
        pct_abstentions: str(row['% Abstentions']),
        expressed: num(row.Exprimés),
        blank: num(row.Blancs),
        null_votes: num(row.Nuls),
      };
    }
Behavior4/5

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

No annotations are provided, but the description discloses the return format (base stats and array of lists) and sorting. It implies a read-only fetch without contradiction. However, it does not state explicitly that it is non-destructive or idempotent.

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 moderately concise, front-loading the purpose and including essential details about the election date, aggregation, and return fields. It could be slightly shorter, but it adds necessary context.

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

Completeness5/5

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

No output schema exists, but the description thoroughly explains the return values: base voting stats and an array of 38 lists with specific fields (panel number, political nuance, etc.) and sorting. This is complete for a zero-parameter tool.

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

Parameters4/5

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

The input schema has no parameters, so the baseline is 4. The description adds no parameter details because there are none, but it is acceptable.

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 it returns 'Final results of the European Parliament elections' for a specific department and date, which is unique among siblings. The verb 'get' and resource 'european_2024' are specific, and the description adds detail about the dataset.

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?

No explicit guidance on when to use this tool versus alternatives, but the data is unique (European elections for Réunion) so its context is clear. Missing explicit when-not-to-use or alternative suggestions.

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/Hug0x0/mcp-reunion'

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