Skip to main content
Glama
ronantakizawa

GIS Data Conversion MCP

wkt_to_geojson

Convert Well-Known Text (WKT) to GeoJSON format for geographic data processing and visualization.

Instructions

Convert Well-Known Text (WKT) to GeoJSON format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wktYesWell-Known Text (WKT) string to convert

Implementation Reference

  • The main handler function for the 'wkt_to_geojson' tool. Parses WKT string using the 'wellknown' library and returns the resulting GeoJSON as a formatted JSON string.
    async wktToGeoJSON(args: any): Promise<ToolResponse> {
      const { wkt } = args;
    
      if (!wkt) {
        throw new McpError(
          ErrorCode.InvalidParams,
          'Missing required parameter: wkt'
        );
      }
    
      try {
        console.error(`[Converting] WKT to GeoJSON: "${wkt.substring(0, 50)}${wkt.length > 50 ? '...' : ''}"`);
        
        const geojson = wellknown.parse(wkt);
        
        if (!geojson) {
          throw new Error('Failed to parse WKT string');
        }
        
        return this.formatToolResponse(JSON.stringify(geojson, null, 2));
      } catch (error) {
        console.error('[Error] WKT to GeoJSON conversion failed:', error);
        throw new McpError(
          ErrorCode.InternalError,
          `WKT to GeoJSON conversion failed: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Defines the input schema and metadata for the 'wkt_to_geojson' tool in the ListTools response.
      name: 'wkt_to_geojson',
      description: 'Convert Well-Known Text (WKT) to GeoJSON format',
      inputSchema: {
        type: 'object',
        properties: {
          wkt: {
            type: 'string',
            description: 'Well-Known Text (WKT) string to convert',
          },
        },
        required: ['wkt'],
      },
    },
  • src/index.ts:280-281 (registration)
    Registers the tool dispatch in the CallToolRequestSchema handler by routing calls to the wktToGeoJSON method.
    case 'wkt_to_geojson':
      return await this.wktToGeoJSON(request.params.arguments);
  • Helper method used by the handler to format the GeoJSON response according to MCP ToolResponse type.
    private formatToolResponse(text: string): ToolResponse {
      return {
        content: [
          {
            type: 'text',
            text
          },
        ],
      };
    }
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. It states the conversion action but doesn't describe error handling (e.g., invalid WKT input), performance characteristics, or output specifics beyond format. For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves in practice.

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 unnecessary words. It's front-loaded with the core action ('Convert') and clearly specifies input and output formats. Every word earns its place, making it highly concise and well-structured.

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

Completeness3/5

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

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic conversion purpose but lacks details on output structure, error cases, or differentiation from siblings. For a straightforward format conversion tool, it meets the minimum viable threshold but doesn't provide rich contextual information.

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%, with the single parameter 'wkt' fully documented in the schema. The description adds no additional parameter semantics beyond implying the input is a WKT string. Since the schema already covers the parameter adequately, the baseline score of 3 is appropriate—the description doesn't add value but doesn't need to compensate for gaps.

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 function: converting WKT to GeoJSON. It specifies both the input format (Well-Known Text) and output format (GeoJSON), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'geojson_to_wkt' or 'kml_to_geojson', which perform related but inverse or different format conversions.

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. With multiple sibling tools for format conversions (e.g., csv_to_geojson, kml_to_geojson), there's no indication of when WKT is the appropriate input format or what distinguishes this from other conversion tools. Usage is implied by the name but not explicitly stated.

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