Skip to main content
Glama
julienkalamon

IGN API Carto MCP Server

Get cadastral commune boundaries

ign_get_cadastre_communes
Read-onlyIdempotent

Retrieve French commune boundaries from the cadastral database using INSEE codes, department codes, or geographic coordinates to support mapping and spatial analysis.

Instructions

Get commune (municipality) boundaries from the cadastral database.

Args:

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

  • code_insee (string, optional): INSEE commune code

  • code_dep (string, optional): Department code

  • _limit (number): Max results (default 500)

  • _start (number): Pagination offset

Returns: GeoJSON FeatureCollection with commune boundaries.

Input Schema

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

Implementation Reference

  • Handler function that queries the cadastre commune API endpoint and formats the GeoJSON response as JSON or markdown.
    async (params) => {
      const { response_format, ...queryParams } = params;
      const data = await apiRequest<unknown>("/cadastre/commune", { 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,
        "Communes cadastrales"
      );
      return {
        content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }],
      };
    }
  • Zod input schema defining parameters: geom (optional GeoJSON), code_insee, code_dep, pagination (_limit, _start), response_format.
    inputSchema: z.object({
      geom: GeometrySchema.optional(),
      code_insee: z.string().optional(),
      code_dep: z.string().optional(),
      ...PaginationSchema,
      response_format: ResponseFormatSchema,
    }).strict(),
  • src/index.ts:196-243 (registration)
    Full registration of the ign_get_cadastre_communes tool including name, metadata, schema, annotations, and inline handler function.
    server.registerTool(
      "ign_get_cadastre_communes",
      {
        title: "Get cadastral commune boundaries",
        description: `Get commune (municipality) boundaries from the cadastral database.
    
    Args:
      - geom (string, optional): GeoJSON geometry to intersect
      - code_insee (string, optional): INSEE commune code
      - code_dep (string, optional): Department code
      - _limit (number): Max results (default 500)
      - _start (number): Pagination offset
    
    Returns:
      GeoJSON FeatureCollection with commune boundaries.`,
        inputSchema: z.object({
          geom: GeometrySchema.optional(),
          code_insee: z.string().optional(),
          code_dep: z.string().optional(),
          ...PaginationSchema,
          response_format: ResponseFormatSchema,
        }).strict(),
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async (params) => {
        const { response_format, ...queryParams } = params;
        const data = await apiRequest<unknown>("/cadastre/commune", { 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,
          "Communes cadastrales"
        );
        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 readOnlyHint=true, destructiveHint=false, openWorldHint=true, and idempotentHint=true. The description adds valuable context about the return format ('GeoJSON FeatureCollection'), pagination behavior (through _limit and _start parameters), and the default response format (implied through the Returns section), which goes beyond what annotations provide.

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 well-structured with clear sections (purpose, Args, Returns) and uses bullet points for readability. It's appropriately sized at 5 sentences, though the Args section could be more concise by integrating parameter descriptions rather than listing them separately.

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 the tool's moderate complexity (6 parameters, no output schema), the description provides good coverage: clear purpose, parameter listing, return format specification, and pagination context. With annotations covering safety and idempotency, and the description adding return format details, it's mostly complete though could benefit from more usage guidance relative to siblings.

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 67% (4 of 6 parameters have descriptions). The description adds minimal parameter semantics beyond the schema - it lists parameters but doesn't provide additional meaning about how they interact (e.g., that geom and code_insee are alternative filtering methods). The schema already documents geom, _limit, _start, and response_format well, so 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 specific action ('Get commune boundaries') and resource ('from the cadastral database'), distinguishing it from siblings like 'ign_get_administrative_limits' or 'ign_get_communes_by_postal_code' by specifying it's cadastral data rather than administrative or postal-based data.

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?

The description implies usage through parameter descriptions (e.g., using geom for intersection, code_insee for specific communes), but doesn't explicitly state when to use this tool versus alternatives like 'ign_get_administrative_limits' or 'ign_get_communes_by_postal_code'. No explicit when-not or alternative guidance is provided.

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