ign_get_gpu_urbanisme
Query French urban planning data including zoning, local plans, and public utility easements from the Géoportail de l'Urbanisme (GPU) database.
Instructions
Query the Géoportail de l'Urbanisme (GPU) for urban planning documents and zones.
This tool accesses French urban planning data including local urban plans (PLU), zoning, and public utility easements.
Available layers:
municipality: Check if commune is under RNU (national regulation)
document: Urban planning documents (PLU, PLUi, CC)
zone-urba: Urban zones (U, AU, A, N)
secteur-cc: Community map sectors
prescription-surf/lin/pct: Surface/linear/point prescriptions
info-surf/lin/pct: Informative zones
assiette-sup-s/l/p: Public utility easement footprints
generateur-sup-s/l/p: Public utility easement generators
Args:
layer (string): GPU layer to query
geom (string, optional): GeoJSON geometry to intersect
partition (string, optional): Document partition ID
categorie (string, optional): SUP category filter
_limit (number): Max results
_start (number): Pagination offset
Returns: GeoJSON FeatureCollection with urban planning data.
Examples:
"Is this commune under RNU?" -> layer="municipality", geom=...
"What's the zoning at this address?" -> layer="zone-urba", geom=...
"Find building prescriptions here" -> layer="prescription-surf", geom=...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | Yes | GPU layer to query | |
| geom | No | GeoJSON geometry string, e.g. {"type":"Point","coordinates":[2.35,48.85]} | |
| partition | No | Document partition ID | |
| categorie | No | SUP category filter | |
| _limit | No | Maximum number of results (1-1000) | |
| _start | No | Starting position for pagination | |
| response_format | No | Output format: 'markdown' for human-readable or 'json' for machine-readable | markdown |
Implementation Reference
- src/index.ts:478-499 (handler)Handler function for the 'ign_get_gpu_urbanisme' tool. It destructures parameters, constructs the GPU endpoint based on the layer, calls apiRequest to fetch data, and returns either JSON or Markdown-formatted GeoJSON response.async (params) => { const { layer, response_format, ...queryParams } = params; const endpoint = `/gpu/${layer}`; 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, `Urbanisme GPU - ${layer}` ); return { content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }], }; }
- src/index.ts:463-470 (schema)Input schema validation using Zod for the ign_get_gpu_urbanisme tool, defining parameters like layer, geom, partition, categorie, pagination, and response_format.inputSchema: z.object({ layer: GPULayerSchema.describe("GPU layer to query"), geom: GeometrySchema.optional(), partition: z.string().optional().describe("Document partition ID"), categorie: z.string().optional().describe("SUP category filter"), ...PaginationSchema, response_format: ResponseFormatSchema, }).strict(),
- src/index.ts:411-428 (schema)Zod enum schema defining valid GPU layers for urban planning data queries.const GPULayerSchema = z.enum([ "municipality", "document", "zone-urba", "secteur-cc", "prescription-surf", "prescription-lin", "prescription-pct", "info-surf", "info-lin", "info-pct", "assiette-sup-s", "assiette-sup-l", "assiette-sup-p", "generateur-sup-s", "generateur-sup-l", "generateur-sup-p", ] as const);
- src/index.ts:430-500 (registration)Registration of the ign_get_gpu_urbanisme tool on the MCP server, including metadata, input schema, annotations, and inline handler function.server.registerTool( "ign_get_gpu_urbanisme", { title: "Get urban planning data (GPU)", description: `Query the Géoportail de l'Urbanisme (GPU) for urban planning documents and zones. This tool accesses French urban planning data including local urban plans (PLU), zoning, and public utility easements. Available layers: - municipality: Check if commune is under RNU (national regulation) - document: Urban planning documents (PLU, PLUi, CC) - zone-urba: Urban zones (U, AU, A, N) - secteur-cc: Community map sectors - prescription-surf/lin/pct: Surface/linear/point prescriptions - info-surf/lin/pct: Informative zones - assiette-sup-s/l/p: Public utility easement footprints - generateur-sup-s/l/p: Public utility easement generators Args: - layer (string): GPU layer to query - geom (string, optional): GeoJSON geometry to intersect - partition (string, optional): Document partition ID - categorie (string, optional): SUP category filter - _limit (number): Max results - _start (number): Pagination offset Returns: GeoJSON FeatureCollection with urban planning data. Examples: - "Is this commune under RNU?" -> layer="municipality", geom=... - "What's the zoning at this address?" -> layer="zone-urba", geom=... - "Find building prescriptions here" -> layer="prescription-surf", geom=...`, inputSchema: z.object({ layer: GPULayerSchema.describe("GPU layer to query"), geom: GeometrySchema.optional(), partition: z.string().optional().describe("Document partition ID"), categorie: z.string().optional().describe("SUP category filter"), ...PaginationSchema, response_format: ResponseFormatSchema, }).strict(), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params) => { const { layer, response_format, ...queryParams } = params; const endpoint = `/gpu/${layer}`; 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, `Urbanisme GPU - ${layer}` ); return { content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }], }; } );