Skip to main content
Glama
Hug0x0

mcp-reunion

reunion_search_ban_addresses

Search geocoded addresses in La Réunion from the Base Adresse Nationale, including coordinates and address components. Useful for address validation and mapping.

Instructions

Search the Base Adresse Nationale (BAN) — France's authoritative geocoded address database — restricted to La Réunion (~353k addresses). Each address has lat/lon, street name, number, postal code, INSEE code, and a position type (entrance, parcel, segment). Use this for geocoding, address validation, last-mile delivery, mapping. Source: IGN / La Poste / DINUM via data.regionreunion.com.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoFree-text search across street name and city
communeNoCommune name prefix match (e.g. "Saint-Denis")
inseeNoINSEE commune code (5 digits as integer, e.g. 97411 for Saint-Denis)
postal_codeNoPostal code as integer (5 digits, Réunion uses 974xx)
limitNoMax addresses to return (1-100, default 20)

Implementation Reference

  • The MCP tool handler for 'reunion_search_ban_addresses'. Registers the tool via server.tool() with the name 'reunion_search_ban_addresses', accepts query/commune/insee/postal_code/limit parameters, queries the 'ban-lareunion' OpenDataSoft dataset via the ReunionClient, and returns formatted address results (number, suffix, street, postal_code, insee_code, commune, lon, lat, position_type).
    server.tool(
      'reunion_search_ban_addresses',
      'Search the Base Adresse Nationale (BAN) — France\'s authoritative geocoded address database — restricted to La Réunion (~353k addresses). Each address has lat/lon, street name, number, postal code, INSEE code, and a position type (entrance, parcel, segment). Use this for geocoding, address validation, last-mile delivery, mapping. Source: IGN / La Poste / DINUM via data.regionreunion.com.',
      {
        query: z.string().optional().describe('Free-text search across street name and city'),
        commune: z.string().optional().describe('Commune name prefix match (e.g. "Saint-Denis")'),
        insee: z.number().int().optional().describe('INSEE commune code (5 digits as integer, e.g. 97411 for Saint-Denis)'),
        postal_code: z.number().int().optional().describe('Postal code as integer (5 digits, Réunion uses 974xx)'),
        limit: z.number().int().min(1).max(100).default(20).describe('Max addresses to return (1-100, default 20)'),
      },
      async ({ query, commune, insee, postal_code, limit }) => {
        try {
          const data = await client.getRecords<RecordObject>(DATASET_BAN, {
            where: buildWhere([
              query ? `search(${quote(query)})` : undefined,
              commune ? `nom_commune LIKE ${quote(`${commune}%`)}` : undefined,
              insee !== undefined ? `code_insee = ${insee}` : undefined,
              postal_code !== undefined ? `code_postal = ${postal_code}` : undefined,
            ]),
            limit,
          });
          return jsonResult({
            total_addresses: data.total_count,
            addresses: data.results.map((row) => ({
              number: pickNumber(row, ['numero']),
              suffix: pickString(row, ['rep']),
              street: pickString(row, ['nom_voie']),
              postal_code: pickNumber(row, ['code_postal']),
              insee_code: pickNumber(row, ['code_insee']),
              commune: pickString(row, ['nom_commune']),
              lon: pickNumber(row, ['lon']),
              lat: pickNumber(row, ['lat']),
              position_type: pickString(row, ['type_position']),
            })),
          });
        } catch (error) {
          return errorResult(error instanceof Error ? error.message : 'Failed to search BAN addresses');
        }
      }
    );
  • Zod-based input schema for the tool. Defines optional parameters: query (string), commune (string), insee (integer), postal_code (integer), and limit (integer, 1-100, default 20).
    {
      query: z.string().optional().describe('Free-text search across street name and city'),
      commune: z.string().optional().describe('Commune name prefix match (e.g. "Saint-Denis")'),
      insee: z.number().int().optional().describe('INSEE commune code (5 digits as integer, e.g. 97411 for Saint-Denis)'),
      postal_code: z.number().int().optional().describe('Postal code as integer (5 digits, Réunion uses 974xx)'),
      limit: z.number().int().min(1).max(100).default(20).describe('Max addresses to return (1-100, default 20)'),
    },
  • Where registerGeographyTools (which contains the tool registration) is called within registerAllTools.
    registerGeographyTools(server);
  • Import of the registerGeographyTools function from geography module.
    import { registerGeographyTools } from './geography.js';
  • buildWhere helper: constructs an ODSQL WHERE clause from an array of conditions, joining them with AND.
    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;
    }
Behavior3/5

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

No annotations are provided, so the description must carry full burden. It mentions the data fields and source (IGN / La Poste / DINUM) but does not disclose side effects, read-only nature, or any special behaviors. However, it does state the restriction to La Réunion addresses, which is a key constraint.

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?

The description is concise (four sentences) and front-loaded with the main purpose and scope. Every sentence adds value: definition, data contents, use cases, data source. No fluff or redundancy.

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?

Given no output schema, the description adequately explains return fields (lat/lon, street, number, postal code, INSEE code, position type) and sources. It covers use cases, but lacks details on error handling or response format, which is acceptable given the simplicity of the tool.

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?

Input schema has 100% coverage with well-described parameters (query, commune, insee, postal_code, limit). The description adds context about the address fields returned but does not enhance parameter understanding beyond the schema. Baseline 3 is appropriate.

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 tool searches the Base Adresse Nationale (BAN) restricted to La Réunion, lists the data fields (lat/lon, street name, etc.), and specifies use cases like geocoding and address validation. It distinguishes itself from sibling tools which focus on other domains.

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?

The description explicitly lists use cases: geocoding, address validation, last-mile delivery, mapping. While it doesn't state when not to use it or name alternatives, the context of Réunion-specific BAN data and the clarity of the use cases provide sufficient guidance for an agent.

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