Skip to main content
Glama
Hug0x0

mcp-reunion

reunion_get_road_traffic

Retrieve average daily traffic counts and heavy-vehicle statistics for any national road segment on Réunion island, sorted by year and traffic volume.

Instructions

Trafic Moyen Journalier Annuel (TMJA, average daily traffic) counts on Réunion national-road segments. Each row is a counted segment between two PR markers (points de repère) for a given year. Returns: route code, year, TMJA in vehicles/day, heavy-vehicle count and percentage, PR start/end, location name, commune, count type (manual vs automatic). Sorted by year then traffic descending. Source: DEAL Réunion via data.regionreunion.com.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routeNoExact national-road code, e.g. "RN1", "RN1A", "RN2", "RN3"
yearNoReference year of the count (4 digits, e.g. 2022)
communeNoCommune name prefix match
limitNoMax segments to return (1-500, default 50)

Implementation Reference

  • The registerTransportTools function registers 'reunion_get_road_traffic' as a server.tool, with the handler (async callback at line 29) that queries the 'trafic-mja-rn-lareunion' dataset and returns TMJA (average daily traffic) data.
    export function registerTransportTools(server: McpServer): void {
      server.tool(
        'reunion_get_road_traffic',
        'Trafic Moyen Journalier Annuel (TMJA, average daily traffic) counts on Réunion national-road segments. Each row is a counted segment between two PR markers (points de repère) for a given year. Returns: route code, year, TMJA in vehicles/day, heavy-vehicle count and percentage, PR start/end, location name, commune, count type (manual vs automatic). Sorted by year then traffic descending. Source: DEAL Réunion via data.regionreunion.com.',
        {
          route: z.string().optional().describe('Exact national-road code, e.g. "RN1", "RN1A", "RN2", "RN3"'),
          year: z.number().int().optional().describe('Reference year of the count (4 digits, e.g. 2022)'),
          commune: z.string().optional().describe('Commune name prefix match'),
          limit: z.number().int().min(1).max(500).default(50).describe('Max segments to return (1-500, default 50)'),
        },
        async ({ route, year, commune, limit }) => {
          try {
            const data = await client.getRecords<RecordObject>(DATASET_TRAFFIC, {
              where: buildWhere([
                route ? `route = ${quote(route)}` : undefined,
                year !== undefined ? `annee = ${year}` : undefined,
                commune ? `commune LIKE ${quote(`${commune}%`)}` : undefined,
              ]),
              order_by: 'annee DESC, tmja DESC',
              limit,
            });
    
            return jsonResult({
              total_segments: data.total_count,
              segments: data.results.map((row) => ({
                route: pickString(row, ['route']),
                year: pickNumber(row, ['annee']),
                tmja_vehicles_per_day: pickNumber(row, ['tmja']),
                heavy_vehicles_count: pickString(row, ['nb_pl']),
                heavy_vehicles_pct: pickString(row, ['pourcentag']),
                pr_start: pickString(row, ['plod']),
                pr_end: pickString(row, ['plof']),
                lieudit: pickString(row, ['lieudit']),
                commune: pickString(row, ['commune']),
                count_type: pickString(row, ['type_compt']),
              })),
            });
          } catch (error) {
            return errorResult(error instanceof Error ? error.message : 'Failed to fetch road traffic');
          }
        }
      );
  • Zod input schema for reunion_get_road_traffic: optional route (string), year (int), commune (string), limit (int, default 50).
    {
      route: z.string().optional().describe('Exact national-road code, e.g. "RN1", "RN1A", "RN2", "RN3"'),
      year: z.number().int().optional().describe('Reference year of the count (4 digits, e.g. 2022)'),
      commune: z.string().optional().describe('Commune name prefix match'),
      limit: z.number().int().min(1).max(500).default(50).describe('Max segments to return (1-500, default 50)'),
    },
  • registration line in registerAllTools that calls registerTransportTools(server) to register the tool.
    registerTransportTools(server);
  • buildWhere helper used by the handler to construct ODSQL WHERE clauses.
    export function buildWhere(
      conditions: Array<string | undefined | null | false>
    ): string | undefined {
      const valid = conditions.filter((condition): condition is string => Boolean(condition));
      return valid.length > 0 ? valid.join(' AND ') : undefined;
    }
  • quote helper used by the handler to safely quote string literals for ODSQL queries.
    export function quote(value: string): string {
      return `'${escapeOdSqlString(value)}'`;
    }
Behavior4/5

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

Discloses data source (DEAL Réunion), sorting order (year then traffic descending), and return fields. No annotations provided, so description carries full burden. Provides good behavioral context.

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?

Concise three-sentence paragraph: what it does, what it returns, sorting and source. No wasted words, front-loaded with key information.

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?

For a simple query tool with 4 optional parameters and no output schema, the description covers data meaning, source, output fields, and sorting. Complete enough for agent to use correctly.

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 coverage is 100%, so baseline is 3. Description reinforces parameter meaning (e.g., 'exact national-road code' for route) but doesn't add significant new semantic details beyond schema.

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?

Clearly states it returns traffic counts on Réunion national-road segments with specific fields and sorting. Differentiates from siblings like reunion_get_road_classification by being specific about counts.

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 vs alternatives like reunion_get_road_daily_flow or reunion_get_road_classification. Implies it's for annual average daily traffic, but lacks exclusionary 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/Hug0x0/mcp-reunion'

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