Skip to main content
Glama
julienkalamon

IGN API Carto MCP Server

Get agricultural parcels (RPG)

ign_get_rpg
Read-onlyIdempotent

Query agricultural parcel data from France's Registre Parcellaire Graphique (RPG) for land use analysis, crop identification, and CAP subsidy verification by providing location and year parameters.

Instructions

Query the Registre Parcellaire Graphique (RPG) for agricultural parcel information.

The RPG contains agricultural land use data declared by farmers for CAP (Common Agricultural Policy) subsidies.

Two versions exist:

  • V1 (2010-2014): Anonymous farm blocks (îlots)

  • V2 (2015+): Graphic parcels with crop information

Args:

  • annee (number): Year of data (2010-2024)

  • geom (string): GeoJSON geometry (required)

  • code_cultu (string, optional): Crop culture code filter

  • _limit (number): Max results

  • _start (number): Pagination offset

Returns: GeoJSON FeatureCollection with:

  • V1: num_ilot, commune, surf_decla, code_cultu, nom_cultu

  • V2: id_parcel, surf_parc, code_cultu, code_group, culture_d1, culture_d2

Examples:

  • "Find crops at this location in 2023" -> annee=2023, geom={"type":"Point",...}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
anneeYesYear (2010-2024)
geomYesGeoJSON geometry (required)
code_cultuNoCrop culture code
_limitNoMaximum number of results (1-1000)
_startNoStarting position for pagination
response_formatNoOutput format: 'markdown' for human-readable or 'json' for machine-readablemarkdown

Implementation Reference

  • The asynchronous handler function implementing the core logic of the 'ign_get_rpg' tool. It destructures parameters, determines the RPG version (v1 or v2) based on the year, makes an API request to the corresponding endpoint, and returns either raw JSON or formatted markdown GeoJSON response.
    async (params) => {
      const { annee, response_format, ...queryParams } = params;
      const version = annee <= 2014 ? "v1" : "v2";
      const endpoint = `/rpg/${version}`;
      
      const data = await apiRequest<unknown>(endpoint, {
        params: { annee, ...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,
        `Parcelles agricoles RPG ${annee}`
      );
      return {
        content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }],
      };
    }
  • Zod input validation schema for the 'ign_get_rpg' tool, defining required 'annee' (2010-2024), 'geom' (GeoJSON), optional 'code_cultu', pagination parameters, and response format.
    inputSchema: z.object({
      annee: z
        .number()
        .int()
        .min(2010)
        .max(2024)
        .describe("Year (2010-2024)"),
      geom: GeometrySchema.describe("GeoJSON geometry (required)"),
      code_cultu: z.string().optional().describe("Crop culture code"),
      ...PaginationSchema,
      response_format: ResponseFormatSchema,
    }).strict(),
  • src/index.ts:249-317 (registration)
    Registration of the 'ign_get_rpg' tool using server.registerTool, including the tool name, metadata (title, description), input schema, annotations, and the handler function.
    server.registerTool(
      "ign_get_rpg",
      {
        title: "Get agricultural parcels (RPG)",
        description: `Query the Registre Parcellaire Graphique (RPG) for agricultural parcel information.
    
    The RPG contains agricultural land use data declared by farmers for CAP (Common Agricultural Policy) subsidies.
    
    Two versions exist:
    - V1 (2010-2014): Anonymous farm blocks (îlots)
    - V2 (2015+): Graphic parcels with crop information
    
    Args:
      - annee (number): Year of data (2010-2024)
      - geom (string): GeoJSON geometry (required)
      - code_cultu (string, optional): Crop culture code filter
      - _limit (number): Max results
      - _start (number): Pagination offset
    
    Returns:
      GeoJSON FeatureCollection with:
      - V1: num_ilot, commune, surf_decla, code_cultu, nom_cultu
      - V2: id_parcel, surf_parc, code_cultu, code_group, culture_d1, culture_d2
    
    Examples:
      - "Find crops at this location in 2023" -> annee=2023, geom={"type":"Point",...}`,
        inputSchema: z.object({
          annee: z
            .number()
            .int()
            .min(2010)
            .max(2024)
            .describe("Year (2010-2024)"),
          geom: GeometrySchema.describe("GeoJSON geometry (required)"),
          code_cultu: z.string().optional().describe("Crop culture code"),
          ...PaginationSchema,
          response_format: ResponseFormatSchema,
        }).strict(),
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: true,
        },
      },
      async (params) => {
        const { annee, response_format, ...queryParams } = params;
        const version = annee <= 2014 ? "v1" : "v2";
        const endpoint = `/rpg/${version}`;
        
        const data = await apiRequest<unknown>(endpoint, {
          params: { annee, ...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,
          `Parcelles agricoles RPG ${annee}`
        );
        return {
          content: [{ type: "text", text: truncateResponse(markdown, CHARACTER_LIMIT) }],
        };
      }
    );
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds valuable behavioral context beyond what annotations provide. While annotations already indicate read-only, open-world, idempotent, and non-destructive operations, the description explains the data source (RPG for CAP subsidies), version differences (V1 vs V2 with different data structures), and return format details (GeoJSON FeatureCollection with specific fields per version). This provides important operational context that annotations alone don't cover.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured and concise. It starts with the core purpose, provides essential context about the RPG and version differences, then clearly lists parameters and returns with specific examples. Every sentence earns its place, and the information is front-loaded with the most important details first. The example at the end provides practical guidance without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (6 parameters, version differences, geographic queries) and the absence of an output schema, the description provides excellent completeness. It explains the data source, version differences, parameter purposes, return format details, and includes a practical example. The combination of annotations and description gives the agent everything needed to use this tool effectively in the context of its sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline would be 3, but the description adds significant semantic value. It explains the significance of the 'annee' parameter in relation to data versions (V1 vs V2), provides context for 'code_cultu' as a crop culture code filter, and clarifies that 'geom' must be a GeoJSON geometry. The description also explains what the return data contains for each version, which helps understand parameter implications.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Query the Registre Parcellaire Graphique (RPG) for agricultural parcel information.' It specifies the exact resource (RPG agricultural land use data) and distinguishes it from siblings by focusing on agricultural parcels rather than administrative limits, cadastre, or other geographic data. The description provides context about CAP subsidies and version differences, making the purpose highly specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage guidance by explaining when to use different versions (V1 for 2010-2014, V2 for 2015+), which helps the agent select appropriate parameters. It also distinguishes this tool from siblings by focusing specifically on agricultural parcel data, unlike administrative or cadastral tools. The example at the end further clarifies typical usage scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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