Skip to main content
Glama
julienkalamon

IGN API Carto MCP Server

Get administrative boundaries

ign_get_administrative_limits
Read-onlyIdempotent

Query French administrative boundaries (communes, departments, regions) using coordinates or geometries to identify locations and retrieve GeoJSON data.

Instructions

Query French administrative boundaries (communes, departments, regions).

This tool accesses administrative limit data from the IGN Admin Express dataset.

Args:

  • type (string): Boundary type - 'commune', 'departement', or 'region'

  • geom (string, optional): GeoJSON geometry to intersect

  • lon (number, optional): Longitude coordinate (use with lat)

  • lat (number, optional): Latitude coordinate (use with lon)

  • _limit (number): Max results (1-1000)

  • _start (number): Pagination offset

Note: Either provide geom OR (lon + lat), but not both.

Returns: GeoJSON FeatureCollection with administrative boundaries.

Examples:

  • "What commune is at this point?" -> type="commune", lon=2.35, lat=48.85

  • "What department is at this point?" -> type="departement", geom={"type":"Point",...}

  • "Get regions intersecting this polygon" -> type="region", geom=...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesAdministrative boundary type
geomNoGeoJSON geometry string, e.g. {"type":"Point","coordinates":[2.35,48.85]}
lonNoLongitude coordinate (use with lat)
latNoLatitude coordinate (use with lon)
_limitNoMaximum number of results (1-1000)
_startNoStarting position for pagination
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

Implementation Reference

  • The handler function executes the tool logic: constructs the API endpoint `/limites-administratives/{type}`, calls apiRequest with query params, and formats the GeoJSON response as JSON or Markdown.
    async (params) => {
      const { type, response_format, ...queryParams } = params;
      const endpoint = `/limites-administratives/${type}`;
    
      const data = await apiRequest<unknown>(endpoint, {
        params: queryParams as Record<string, string | number | boolean | undefined>,
      });
    
      if (response_format === ResponseFormat.JSON) {
        return {
          content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
        };
      }
    
      const markdown = formatGeoJSONToMarkdown(
        data as import("./types.js").GeoJSONFeatureCollection,
        `Limites administratives - ${type}`
      );
      return {
        content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }],
      };
    }
  • Zod input schema validating parameters: required 'type' (commune, departement, region), optional geom, lon, lat, pagination (_limit, _start), and response_format.
    inputSchema: z.object({
      type: z
        .enum(["commune", "departement", "region"] as const)
        .describe("Administrative boundary type"),
      geom: GeometrySchema.optional(),
      lon: z.number().optional().describe("Longitude coordinate (use with lat)"),
      lat: z.number().optional().describe("Latitude coordinate (use with lon)"),
      ...PaginationSchema,
      response_format: ResponseFormatSchema,
    }).strict(),
  • src/index.ts:646-710 (registration)
    Registers the 'ign_get_administrative_limits' tool on the MCP server, including title, description, input schema, annotations, and inline handler function.
    server.registerTool(
      "ign_get_administrative_limits",
      {
        title: "Get administrative boundaries",
        description: `Query French administrative boundaries (communes, departments, regions).
    
    This tool accesses administrative limit data from the IGN Admin Express dataset.
    
    Args:
      - type (string): Boundary type - 'commune', 'departement', or 'region'
      - geom (string, optional): GeoJSON geometry to intersect
      - lon (number, optional): Longitude coordinate (use with lat)
      - lat (number, optional): Latitude coordinate (use with lon)
      - _limit (number): Max results (1-1000)
      - _start (number): Pagination offset
    
    Note: Either provide geom OR (lon + lat), but not both.
    
    Returns:
      GeoJSON FeatureCollection with administrative boundaries.
    
    Examples:
      - "What commune is at this point?" -> type="commune", lon=2.35, lat=48.85
      - "What department is at this point?" -> type="departement", geom={"type":"Point",...}
      - "Get regions intersecting this polygon" -> type="region", geom=...`,
        inputSchema: z.object({
          type: z
            .enum(["commune", "departement", "region"] as const)
            .describe("Administrative boundary type"),
          geom: GeometrySchema.optional(),
          lon: z.number().optional().describe("Longitude coordinate (use with lat)"),
          lat: z.number().optional().describe("Latitude coordinate (use with lon)"),
          ...PaginationSchema,
          response_format: ResponseFormatSchema,
        }).strict(),
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async (params) => {
        const { type, response_format, ...queryParams } = params;
        const endpoint = `/limites-administratives/${type}`;
    
        const data = await apiRequest<unknown>(endpoint, {
          params: queryParams as Record<string, string | number | boolean | undefined>,
        });
    
        if (response_format === ResponseFormat.JSON) {
          return {
            content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
          };
        }
    
        const markdown = formatGeoJSONToMarkdown(
          data as import("./types.js").GeoJSONFeatureCollection,
          `Limites administratives - ${type}`
        );
        return {
          content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }],
        };
      }
    );
Behavior4/5

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

Annotations already provide strong behavioral hints (readOnlyHint: true, openWorldHint: true, idempotentHint: true, destructiveHint: false). The description adds valuable context by specifying the data source (IGN Admin Express dataset) and clarifying the return format (GeoJSON FeatureCollection). While it doesn't mention rate limits or authentication needs, it provides useful behavioral information beyond what annotations offer.

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 perfectly structured and front-loaded: purpose statement first, then data source, followed by parameter guidance, return format, and examples. Every sentence earns its place, with no redundant information. The examples are particularly efficient at demonstrating usage patterns.

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 query tool with comprehensive annotations (readOnly, openWorld, idempotent) and 100% schema coverage, the description provides excellent context. It explains the data source, clarifies parameter dependencies, specifies the return format (GeoJSON FeatureCollection), and includes practical examples. The absence of an output schema is compensated by the clear return format description.

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?

With 100% schema description coverage, the baseline is 3. The description adds significant value by explaining parameter relationships ('Either provide geom OR (lon + lat), but not both') and providing concrete examples showing how parameters work together. It also clarifies the purpose of the 'type' parameter by listing the three boundary types, though this information is already in the schema's enum.

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's purpose: 'Query French administrative boundaries (communes, departments, regions)' and specifies it accesses data from the IGN Admin Express dataset. This distinguishes it from sibling tools like ign_get_communes_by_postal_code or ign_get_cadastre_communes by focusing specifically on administrative boundaries rather than postal codes or cadastral data.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Either provide geom OR (lon + lat), but not both' and includes three concrete examples showing when to use different parameter combinations. The examples clearly demonstrate different use cases (point queries vs. intersection queries) with specific parameter configurations.

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/julienkalamon/ign-apicarto-mcp-server'

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