Skip to main content
Glama

urbanisme

Retrieve urban planning regulations (PLU, PLUi, POS, CC, PSMV) for specific coordinates using France's Géoplateforme data to check land use restrictions and zoning information.

Instructions

Renvoie les informations du document d'urbanisme (PLU, PLUi, POS, CC, PSMV) pour une position donnée par sa longitude et sa latitude (source: Géoplateforme - (WFS Géoportail de l'Urbanisme)).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lonYesLa longitude du point
latYesLa latitude du point

Implementation Reference

  • The execute method of UrbanismeTool, which handles the tool invocation by logging and calling the getUrbanisme helper function.
    async execute(input: UrbanismeInput) { logger.info(`urbanisme(${input.lon},${input.lat})...`); return getUrbanisme(input.lon, input.lat); }
  • Zod-based input schema defining longitude (lon) and latitude (lat) as numbers with descriptions.
    schema = { lon: { type: z.number(), description: "La longitude du point", }, lat: { type: z.number(), description: "La latitude du point", }, };
  • Class definition extending MCPTool, setting the tool name to 'urbanisme' and providing a detailed description including the data source.
    class UrbanismeTool extends MCPTool<UrbanismeInput> { name = "urbanisme"; description = `Renvoie les informations du document d'urbanisme (PLU, PLUi, POS, CC, PSMV) pour une position donnée par sa longitude et sa latitude (source: ${URBANISME_SOURCE}).`;
  • Helper function that performs the actual API call to Géoplateforme WFS service to retrieve urbanisme features (SCOT, PLU, etc.) within 30 meters of the given coordinates, processes the features to include type, id, bbox, and distance.
    export async function getUrbanisme(lon, lat) { logger.info(`getUrbanisme(${lon},${lat})...`); // note that EPSG:4326 means lat,lon order for GeoServer -> flipped coordinates... const cql_filter = `DWITHIN(the_geom,Point(${lat} ${lon}),30,meters)`; const sourceGeom = { "type": "Point", "coordinates": [lon,lat] }; // TODO : avoid useless geometry retrieval at WFS level const url = 'https://data.geopf.fr/wfs?' + new URLSearchParams({ service: 'WFS', request: 'GetFeature', typeName: URBANISME_TYPES.join(','), outputFormat: 'application/json', cql_filter: cql_filter }).toString(); const featureCollection = await fetchJSON(url); return featureCollection.features.map((feature) => { // parse type from id (ex: "commune.3837") const type = feature.id.split('.')[0]; // ignore geometry and extend properties return Object.assign({ type: type, id: feature.id, bbox: feature.bbox, distance: (distance( sourceGeom, feature.geometry ) * 1000.0) }, feature.properties); }); }

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/ignfab/geocontext'

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