Skip to main content
Glama

ign_get_cadastre_communes

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) }], }; } );

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