Skip to main content
Glama

ign_wfs_geoportail

Query French geographic WFS layers by intersecting with a geometry to retrieve spatial data like communes, buildings, or administrative boundaries in GeoJSON format.

Instructions

Generic query interface for Geoportail WFS layers.

This tool provides access to various WFS layers from the IGN Geoportail. It allows querying any WFS layer by intersection with a geometry.

Args:

  • source (string): WFS data source name (e.g., "BDTOPO_V3:commune", "LIMITES_ADMINISTRATIVES_EXPRESS.LATEST:commune")

  • geom (string): GeoJSON geometry to intersect (required, in WGS84/EPSG:4326)

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

  • _start (number): Pagination offset

Returns: GeoJSON FeatureCollection with features from the requested layer.

Note: Only WGS84 (EPSG:4326) geometries are supported.

Examples:

  • "Get BDTOPO communes at this point" -> source="BDTOPO_V3:commune", geom={"type":"Point","coordinates":[2.35,48.85]}

  • "Find buildings in this area" -> source="BDTOPO_V3:batiment", geom=...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesWFS data source name (e.g., 'BDTOPO_V3:commune')
geomYesGeoJSON geometry (required, in WGS84/EPSG:4326)
_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 processes input parameters, queries the external WFS Geoportail API endpoint via apiRequest, and returns formatted GeoJSON response as JSON or Markdown.
    async (params) => { const { source, response_format, ...queryParams } = params; const data = await apiRequest<unknown>("/wfs-geoportail/search", { params: { source, ...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, `WFS Geoportail - ${source}` ); return { content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }], }; }
  • Zod input schema defining parameters: source (WFS layer), geom (GeoJSON), pagination (_limit, _start), and response_format.
    inputSchema: z.object({ source: z.string().describe("WFS data source name (e.g., 'BDTOPO_V3:commune')"), geom: GeometrySchema.describe("GeoJSON geometry (required, in WGS84/EPSG:4326)"), ...PaginationSchema, response_format: ResponseFormatSchema, }).strict(),
  • src/index.ts:581-640 (registration)
    Registers the 'ign_wfs_geoportail' MCP tool with metadata, schema, and inline handler function.
    server.registerTool( "ign_wfs_geoportail", { title: "Query WFS Geoportail layers", description: `Generic query interface for Geoportail WFS layers. This tool provides access to various WFS layers from the IGN Geoportail. It allows querying any WFS layer by intersection with a geometry. Args: - source (string): WFS data source name (e.g., "BDTOPO_V3:commune", "LIMITES_ADMINISTRATIVES_EXPRESS.LATEST:commune") - geom (string): GeoJSON geometry to intersect (required, in WGS84/EPSG:4326) - _limit (number): Max results (1-1000) - _start (number): Pagination offset Returns: GeoJSON FeatureCollection with features from the requested layer. Note: Only WGS84 (EPSG:4326) geometries are supported. Examples: - "Get BDTOPO communes at this point" -> source="BDTOPO_V3:commune", geom={"type":"Point","coordinates":[2.35,48.85]} - "Find buildings in this area" -> source="BDTOPO_V3:batiment", geom=...`, inputSchema: z.object({ source: z.string().describe("WFS data source name (e.g., 'BDTOPO_V3:commune')"), geom: GeometrySchema.describe("GeoJSON geometry (required, in WGS84/EPSG:4326)"), ...PaginationSchema, response_format: ResponseFormatSchema, }).strict(), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params) => { const { source, response_format, ...queryParams } = params; const data = await apiRequest<unknown>("/wfs-geoportail/search", { params: { source, ...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, `WFS Geoportail - ${source}` ); 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