Skip to main content
Glama

gva_export_geojson

Export geographic features from GVA GIS data to GeoJSON format for analysis, filtering by SQL queries and selecting specific fields.

Instructions

Export features to GeoJSON format

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
whereNoSQL WHERE clause to filter features1=1
out_fieldsNoComma-separated field names or '*' for all*
result_record_countNoMaximum number of features to export

Implementation Reference

  • Python handler implementation for the gva_export_geojson tool. Queries the ArcGIS FeatureServer with provided parameters, converts the features to GeoJSON FeatureCollection format, and returns it as text content.
    elif name == "gva_export_geojson":
        # Export to GeoJSON
        url = f"{BASE_URL}/{LAYER_ID}/query"
        params = {
            'where': arguments.get('where', '1=1'),
            'outFields': arguments.get('out_fields', '*'),
            'returnGeometry': 'true',
            'resultRecordCount': arguments.get('result_record_count', 100),
            'f': 'json'
        }
    
        data = make_request(url, params)
    
        # Convert to GeoJSON
        features = data.get('features', [])
        geojson_features = []
    
        for feature in features:
            geojson_feature = {
                'type': 'Feature',
                'properties': feature.get('attributes', {}),
                'geometry': feature.get('geometry', {})
            }
            geojson_features.append(geojson_feature)
    
        geojson = {
            'type': 'FeatureCollection',
            'features': geojson_features
        }
    
        return [TextContent(
            type="text",
            text=json.dumps(geojson, indent=2, ensure_ascii=False)
        )]
  • TypeScript handler implementation for the gva_export_geojson tool. Queries the ArcGIS FeatureServer using fetch, converts features to GeoJSON FeatureCollection, and returns as text content.
    case "gva_export_geojson": {
      // Export to GeoJSON
      const exportArgs = args as ExportGeoJsonArguments;
      const url = `${BASE_URL}/${LAYER_ID}/query`;
      const params: RequestParams = {
        where: exportArgs.where || "1=1",
        outFields: exportArgs.out_fields || "*",
        returnGeometry: "true",
        resultRecordCount: exportArgs.result_record_count || 100,
        f: "json",
      };
    
      const data = await makeRequest(url, params);
    
      // Convert to GeoJSON
      const features = (data.features || []).map((feature: any) => ({
        type: "Feature",
        properties: feature.attributes || {},
        geometry: feature.geometry || {},
      }));
    
      const geojson = {
        type: "FeatureCollection",
        features,
      };
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(geojson, null, 2),
          },
        ],
      };
    }
  • Registration of the gva_export_geojson tool in the Python MCP server's list_tools() function, including description and input schema.
    Tool(
        name="gva_export_geojson",
        description="Export features to GeoJSON format",
        inputSchema={
            "type": "object",
            "properties": {
                "where": {
                    "type": "string",
                    "description": "SQL WHERE clause to filter features",
                    "default": "1=1"
                },
                "out_fields": {
                    "type": "string",
                    "description": "Comma-separated field names or '*' for all",
                    "default": "*"
                },
                "result_record_count": {
                    "type": "integer",
                    "description": "Maximum number of features to export",
                    "default": 100
                }
            },
            "required": []
        }
    )
  • Registration of the gva_export_geojson tool in the TypeScript MCP server's list tools handler, including description and input schema.
    {
      name: "gva_export_geojson",
      description: "Export features to GeoJSON format",
      inputSchema: {
        type: "object",
        properties: {
          where: {
            type: "string",
            description: "SQL WHERE clause to filter features",
            default: "1=1",
          },
          out_fields: {
            type: "string",
            description: "Comma-separated field names or '*' for all",
            default: "*",
          },
          result_record_count: {
            type: "number",
            description: "Maximum number of features to export",
            default: 100,
          },
        },
        required: [],
      },
    },
  • TypeScript type definition (schema) for the input arguments of gva_export_geojson.
    interface ExportGeoJsonArguments {
      where?: string;
      out_fields?: string;
      result_record_count?: number;
    }
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. While 'Export' implies a read operation that outputs data, the description doesn't mention whether this tool is safe (non-destructive), has rate limits, requires authentication, or what the output format entails beyond 'GeoJSON format'. This leaves significant behavioral gaps.

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 extremely concise—a single, clear sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function without unnecessary elaboration.

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 tool's complexity (exporting data with filtering and field selection), lack of annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects, usage context, or output details, leaving the agent with insufficient information to use the tool effectively beyond basic parameter passing.

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 description adds no parameter-specific information beyond what's already in the input schema, which has 100% coverage. The schema fully documents all three parameters (where, out_fields, result_record_count) with clear descriptions and defaults. The description doesn't compensate or provide additional context, so it meets the baseline of 3.

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 action ('Export') and the resource ('features to GeoJSON format'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its siblings (gva_count, gva_layer_info, gva_query), which all appear to work with similar geospatial data but serve different purposes.

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 its siblings or alternatives. There's no mention of prerequisites, appropriate contexts, or exclusions. The agent must infer usage from the tool name and description alone.

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/pepo1275/mcp4gva'

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