Skip to main content
Glama
GIS MCP Server
by mahdin75

clip_raster_with_shapefile

Clips raster data to shapefile polygon boundaries and saves the result, reprojecting the shapefile to the raster CRS when needed. Use it to extract raster areas for a region of interest.

Instructions

Clip a raster to shapefile polygons and save it. The shapefile is reprojected to the raster CRS when needed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "raster_path_or_url": "<raster_path_or_url>",
      "shapefile_path": "<shapefile_path>",
      "destination": "<destination>"
    },
    "name": "clip_raster_with_shapefile"
  }
}

Input Schema

NameRequiredDescriptionDefault
destinationYes
shapefile_pathYes
raster_path_or_urlYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.16.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. Changed5 schema fields changedv1.0.0
    • removedInput schema / properties / destination / title
      Removed value: -"Destination"
    • removedInput schema / properties / raster_path_or_url / title
      Removed value: -"Raster Path Or Url"
    • removedInput schema / properties / shapefile_path / title
      Removed value: -"Shapefile Path"
    • removedInput schema / title
      Removed value: -"clip_raster_with_shapefileArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  3. First observed

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden. It helpfully notes the shapefile is reprojected to the raster CRS when needed, and that output is written to a destination, but it omits overwrite behavior, required permissions, output format, and what is returned.

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

Conciseness4/5

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

Two tight sentences with the core action and the CRS caveat front-loaded; no wasted words. Brevity is close to ideal for a tool this simple.

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?

For a three-parameter write-producing tool with no annotations and no output schema, the description covers the workflow and CRS handling but leaves destination semantics and return behavior unspecified. Adequate, with clear gaps an agent would want filled.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for all three parameters. It implies the roles of raster and shapefile inputs and a save destination, but never clarifies whether destination is a file path or directory, whether it must pre-exist, or what raster sources (path vs URL) are accepted.

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 states a specific verb and resource ("Clip a raster to shapefile polygons and save it"), which is unambiguous and distinguishable from the vector-oriented sibling clip_vector. It could be sharper only by explicitly contrasting itself with vector clipping alternatives.

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?

There is no statement of when to use this rather than clip_vector or extract_band, no prerequisites, and no exclusions. Use is only inferable from the tool name.

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