Skip to main content
Glama

clip_layer_to_extent

Clip a layer to a specified bounding box or to the extent of a reference layer, saving the result as a new layer without altering the original.

Instructions

Clip a layer to a bounding-box extent, saving the result as a new layer.

Provide exactly one of reference_layer_name (clip to that layer's extent) or bbox as [xmin, ymin, xmax, ymax] (crs defaults to the source layer's CRS if omitted). This clips to the rectangular extent, not the reference layer's actual feature geometries. The original layer is left untouched.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
crsNo
bboxNo
nameNo
layer_nameYes
reference_layer_nameNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that the original layer is left untouched, that a new layer is created, and that the clip is to a rectangular extent rather than feature geometries. It also mentions parameter defaults (crs). Lacks details on error handling or performance, but the essential behavioral traits are covered.

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, using two short paragraphs and four sentences. Every sentence adds value: the first states the main action, the second provides parameter guidance. No superfluous information.

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

Completeness4/5

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

Given the tool's moderate complexity (5 parameters, output schema present), the description is largely complete. It covers the core operation, parameter constraints, and an important behavioral nuance (rectangular vs. feature clip). It does not address error cases or validation, but these are less critical for such a straightforward clipping operation.

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

Parameters5/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. It explains the role of `reference_layer_name` and `bbox`, describes bbox format as [xmin, ymin, xmax, ymax], and notes crs default. The name parameter is implied by 'saving the result as a new layer'. This provides substantial meaning beyond the raw schema.

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

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'clip' and identifies the resource as 'a layer', while clearly stating the result is 'saving the result as a new layer'. It distinguishes itself from sibling tools like 'filter_layer_by_expression' by focusing on a bounding-box extent rather than attribute expressions.

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

Usage Guidelines4/5

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

Explicitly states to provide exactly one of `reference_layer_name` or `bbox`, and clarifies that the clip is to the rectangular extent, not the reference layer's geometries. It does not explicitly mention when to use this tool versus alternatives like 'get_layer_extent_wkt' or 'reproject_layer', but the guidance is clear enough for most use cases.

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/piatkowski/qgis-mcp'

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