Skip to main content
Glama
ronantakizawa

GIS Data Conversion MCP

geojson_to_wkt

Convert GeoJSON objects to Well-Known Text (WKT) format for geographic data interoperability and analysis in GIS applications.

Instructions

Convert GeoJSON to Well-Known Text (WKT) format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojsonYesGeoJSON object to convert

Implementation Reference

  • The main handler function for the 'geojson_to_wkt' tool. It validates input, uses the 'wellknown' library to convert GeoJSON to WKT, handles errors, and returns a formatted tool response.
    async geoJSONToWKT(args: any): Promise<ToolResponse> {
      const { geojson } = args;
    
      if (!geojson) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Missing required parameter: geojson'
        );
      }
    
      try {
        console.error(`[Converting] GeoJSON to WKT: ${JSON.stringify(geojson).substring(0, 50)}...`);
        
        const wkt = wellknown.stringify(geojson);
        
        if (!wkt) {
          throw new Error('Failed to convert GeoJSON to WKT');
        }
        
        return this.formatToolResponse(wkt);
      } catch (error) {
        console.error('[Error] GeoJSON to WKT conversion failed:', error);
        throw new McpError(
          ErrorCode.InternalError,
          `GeoJSON to WKT conversion failed: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • src/index.ts:105-118 (registration)
    The tool registration entry in the ListTools response, defining the name, description, and input schema for 'geojson_to_wkt'.
    {
      name: 'geojson_to_wkt',
      description: 'Convert GeoJSON to Well-Known Text (WKT) format',
      inputSchema: {
        type: 'object',
        properties: {
          geojson: {
            type: 'object',
            description: 'GeoJSON object to convert',
          },
        },
        required: ['geojson'],
      },
    },
  • The input schema for the 'geojson_to_wkt' tool, specifying that a 'geojson' object is required.
    inputSchema: {
      type: 'object',
      properties: {
        geojson: {
          type: 'object',
          description: 'GeoJSON object to convert',
        },
      },
      required: ['geojson'],
    },
  • The switch case in the CallToolRequest handler that routes calls to the geoJSONToWKT method.
    case 'geojson_to_wkt':
      return await this.geoJSONToWKT(request.params.arguments);
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the conversion action but doesn't describe any behavioral traits such as error handling (e.g., invalid GeoJSON input), performance characteristics (e.g., speed or limitations), or output specifics (e.g., WKT version or precision). This leaves significant gaps for an agent to understand how the tool behaves beyond the basic function.

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 a single, efficient sentence that directly states the tool's purpose without any wasted words. It's front-loaded with the core action ('Convert'), making it easy to parse quickly. Every part of the sentence earns its place by specifying the input and output formats.

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 the complexity of a data conversion tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., WKT string format), potential errors, or how it relates to sibling tools. For a tool that transforms geospatial data, more context is needed to ensure reliable use by an agent.

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?

The input schema has 100% description coverage, with the 'geojson' parameter documented as 'GeoJSON object to convert'. The description doesn't add any meaning beyond this, such as examples of valid GeoJSON structures or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 verb 'Convert' and the resource 'GeoJSON to Well-Known Text (WKT) format', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'geojson_to_csv' or 'geojson_to_kml', which perform similar format conversions but to different targets.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention scenarios where WKT is preferred over other formats (e.g., CSV, KML) or when to choose sibling tools like 'wkt_to_geojson' for the reverse operation. There's no context on prerequisites or exclusions.

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