Skip to main content
Glama
ronantakizawa

GIS Data Conversion MCP

geojson_to_kml

Convert GeoJSON data to KML format for use in mapping applications. Specify document properties and field mappings during conversion.

Instructions

Convert GeoJSON to KML format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojsonYesGeoJSON object to convert
documentNameNoName for the KML documentGeoJSON Conversion
documentDescriptionNoDescription for the KML documentConverted from GeoJSON by GIS Format Conversion MCP
namePropertyNoProperty name in GeoJSON to use as KML namename
descriptionPropertyNoProperty name in GeoJSON to use as KML descriptiondescription

Implementation Reference

  • The handler function that executes the geojson_to_kml tool, parsing arguments, calling tokml library to convert GeoJSON to KML, and formatting the response.
    async geojsonToKML(args: any): Promise<ToolResponse> {
      const { 
        geojson, 
        documentName = 'GeoJSON Conversion', 
        documentDescription = 'Converted from GeoJSON by GIS Format Conversion MCP', 
        nameProperty = 'name',
        descriptionProperty = 'description'
      } = args;
      
      if (!geojson) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Missing required parameter: geojson'
        );
      }
      
      try {
        console.error('[Converting] GeoJSON to KML');
        
        // Set up options for tokml
        const options = {
          documentName: documentName,
          documentDescription: documentDescription,
          name: nameProperty,
          description: descriptionProperty
        };
        
        // Convert GeoJSON to KML using tokml
        const kml = tokml(geojson, options);
        
        return this.formatToolResponse(kml);
      } catch (error) {
        console.error('[Error] GeoJSON to KML conversion failed:', error);
        throw new McpError(
          ErrorCode.InternalError,
          `GeoJSON to KML conversion failed: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • src/index.ts:221-253 (registration)
    Tool registration in the ListTools handler, defining name, description, and input schema for geojson_to_kml.
    {
      name: 'geojson_to_kml',
      description: 'Convert GeoJSON to KML format',
      inputSchema: {
        type: 'object',
        properties: {
          geojson: {
            type: 'object',
            description: 'GeoJSON object to convert',
          },
          documentName: {
            type: 'string',
            description: 'Name for the KML document',
            default: 'GeoJSON Conversion',
          },
          documentDescription: {
            type: 'string',
            description: 'Description for the KML document',
            default: 'Converted from GeoJSON by GIS Format Conversion MCP',
          },
          nameProperty: {
            type: 'string',
            description: 'Property name in GeoJSON to use as KML name',
            default: 'name',
          },
          descriptionProperty: {
            type: 'string',
            description: 'Property name in GeoJSON to use as KML description',
            default: 'description',
          }
        },
        required: ['geojson'],
      },
  • src/index.ts:294-295 (registration)
    Dispatch case in CallToolRequestSchema handler that routes calls to the geojsonToKML method.
    case 'geojson_to_kml':
      return await this.geojsonToKML(request.params.arguments);
  • Input schema definition for the geojson_to_kml tool, specifying parameters and validation.
    inputSchema: {
      type: 'object',
      properties: {
        geojson: {
          type: 'object',
          description: 'GeoJSON object to convert',
        },
        documentName: {
          type: 'string',
          description: 'Name for the KML document',
          default: 'GeoJSON Conversion',
        },
        documentDescription: {
          type: 'string',
          description: 'Description for the KML document',
          default: 'Converted from GeoJSON by GIS Format Conversion MCP',
        },
        nameProperty: {
          type: 'string',
          description: 'Property name in GeoJSON to use as KML name',
          default: 'name',
        },
        descriptionProperty: {
          type: 'string',
          description: 'Property name in GeoJSON to use as KML description',
          default: 'description',
        }
      },
      required: ['geojson'],
  • Import of the tokml library used by the geojson_to_kml handler for conversion.
    import tokml from 'tokml';
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Convert' implies a transformation operation, but the description doesn't disclose any behavioral traits: no information about what the tool returns (KML string? file?), whether it validates input, performance characteristics, error conditions, or any side effects. For a format conversion tool with zero annotation coverage, this is inadequate.

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 concise at just 4 words: 'Convert GeoJSON to KML format'. Every word earns its place - it states the action, source format, and target format with zero waste. It's front-loaded with the essential information.

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

Completeness2/5

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

Given this is a format conversion tool with 5 parameters, no annotations, and no output schema, the description is insufficiently complete. It doesn't explain what the tool returns (KML data structure? string? file path?), doesn't mention error handling for invalid GeoJSON, and provides no context about typical conversion scenarios. The 100% schema coverage helps with parameters, but the overall context is incomplete for practical use.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly with descriptions and defaults. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain relationships between parameters, provide examples of valid GeoJSON objects, or clarify how properties map to KML elements beyond what the parameter descriptions already state.

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

Purpose4/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 as 'Convert GeoJSON to KML format', which is a specific verb+resource action. It distinguishes from some siblings like 'geojson_to_csv' or 'geojson_to_topojson' by specifying the target format, but doesn't explicitly differentiate from all conversion tools in the family.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention when KML format is preferred over other formats (like CSV, TopoJSON, or WKT) or when to use the reverse conversion tool 'kml_to_geojson'. There's no context about typical use cases or prerequisites.

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/ronantakizawa/gis-dataconvertersion-mcp'

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