ign_get_nature_areas
Query protected natural areas in France including Natura 2000 sites, national parks, ZNIEFF zones, and other conservation areas using geographic coordinates or identifiers.
Instructions
Query protected natural areas in France (Natura 2000, ZNIEFF, national parks, etc.).
Available layers:
natura2000-oiseaux: Natura 2000 bird directive sites
natura2000-habitat: Natura 2000 habitat directive sites
rnc: Corsican natural reserves
rnn: National natural reserves
rncf: Hunting and wildlife natural reserves
pn: National parks
pnr: Regional natural parks
znieff1: ZNIEFF type 1 (remarkable ecological areas)
znieff2: ZNIEFF type 2 (large natural ensembles)
sic: Sites of Community Importance
zps: Special Protection Areas
Args:
layer (string): Nature layer to query
geom (string, optional): GeoJSON geometry to intersect
id_mnhn (string, optional): MNHN identifier
_limit (number): Max results
_start (number): Pagination offset
Returns: GeoJSON FeatureCollection with protected area boundaries and attributes.
Examples:
"Find Natura 2000 sites at this location" -> layer="natura2000-habitat", geom=...
"Get ZNIEFF zones near Paris" -> layer="znieff1", geom=...
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | Yes | Nature layer to query | |
| geom | No | GeoJSON geometry string, e.g. {"type":"Point","coordinates":[2.35,48.85]} | |
| id_mnhn | No | MNHN (Natural History Museum) identifier | |
| _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:383-404 (handler)The handler function for 'ign_get_nature_areas' tool. It takes parameters including layer and optional geom/id_mnhn/etc., calls the API endpoint `/nature/${layer}` with query params, fetches GeoJSON data, and returns either raw JSON or Markdown-formatted response.async (params) => { const { layer, response_format, ...queryParams } = params; const endpoint = `/nature/${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, `Espaces naturels - ${layer}` ); return { content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }], }; }
- src/index.ts:323-335 (schema)Zod schema defining the enum of valid 'layer' values specific to the ign_get_nature_areas tool (protected natural areas layers).const NatureLayerSchema = z.enum([ "natura2000-oiseaux", "natura2000-habitat", "rnc", "rnn", "rncf", "pn", "pnr", "znieff1", "znieff2", "sic", "zps", ] as const);
- src/index.ts:337-405 (registration)Registration of the 'ign_get_nature_areas' tool using server.registerTool, including title, description, inputSchema (using NatureLayerSchema), annotations, and inline handler function.server.registerTool( "ign_get_nature_areas", { title: "Get protected natural areas", description: `Query protected natural areas in France (Natura 2000, ZNIEFF, national parks, etc.). Available layers: - natura2000-oiseaux: Natura 2000 bird directive sites - natura2000-habitat: Natura 2000 habitat directive sites - rnc: Corsican natural reserves - rnn: National natural reserves - rncf: Hunting and wildlife natural reserves - pn: National parks - pnr: Regional natural parks - znieff1: ZNIEFF type 1 (remarkable ecological areas) - znieff2: ZNIEFF type 2 (large natural ensembles) - sic: Sites of Community Importance - zps: Special Protection Areas Args: - layer (string): Nature layer to query - geom (string, optional): GeoJSON geometry to intersect - id_mnhn (string, optional): MNHN identifier - _limit (number): Max results - _start (number): Pagination offset Returns: GeoJSON FeatureCollection with protected area boundaries and attributes. Examples: - "Find Natura 2000 sites at this location" -> layer="natura2000-habitat", geom=... - "Get ZNIEFF zones near Paris" -> layer="znieff1", geom=...`, inputSchema: z.object({ layer: NatureLayerSchema.describe("Nature layer to query"), geom: GeometrySchema.optional(), id_mnhn: z.string().optional().describe("MNHN (Natural History Museum) identifier"), ...PaginationSchema, response_format: ResponseFormatSchema, }).strict(), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async (params) => { const { layer, response_format, ...queryParams } = params; const endpoint = `/nature/${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, `Espaces naturels - ${layer}` ); return { content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }], }; } );