Skip to main content
Glama
GIS MCP Server
by mahdin75

sjoin_nearest_gpd

Performs a spatial join, matching each feature to the nearest feature in another file, with optional max_distance in CRS units.

Instructions

Join each feature to the nearest feature in another file. Optional max_distance is in CRS units.

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": {
      "left_path": "<left_path>",
      "right_path": "<right_path>"
    },
    "name": "sjoin_nearest_gpd"
  }
}

Input Schema

NameRequiredDescriptionDefault
howNoleft
offsetNo
columnsNo
left_pathYes
precisionNo
right_pathYes
output_pathNo
max_distanceNo
max_featuresNo
include_geometryNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.16.0
    • addedInput schema / properties / columns
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • addedInput schema / properties / include_geometry
      Added value: +{
      +  "default": true,
      +  "type": "boolean"
      +}
    • addedInput schema / properties / max_features
      Added value: +{
      +  "default": 5,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / precision
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  2. Changed11 schema fields changedv1.0.0
    • removedInput schema / properties / how / title
      Removed value: -"How"
    • removedInput schema / properties / left_path / title
      Removed value: -"Left Path"
    • addedInput schema / properties / max_distance / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / max_distance / title
      Removed value: -"Max Distance"
    • removedInput schema / properties / max_distance / type
      Removed value: -"number"
    • addedInput schema / properties / output_path / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / output_path / title
      Removed value: -"Output Path"
    • removedInput schema / properties / output_path / type
      Removed value: -"string"
    • removedInput schema / properties / right_path / title
      Removed value: -"Right Path"
    • removedInput schema / title
      Removed value: -"sjoin_nearest_gpdArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  3. First observed

TDQS

C2.7/5.0
Behavior2/5

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

With no annotations at all, the description carries the full burden and does not say whether this writes to disk, what happens to features with no neighbor within max_distance, or how the join key columns are named. The single disclosure of CRS units for max_distance is useful but leaves nearly all behavior undisclosed.

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 short, front-loaded sentences with no filler, and the operation is stated first with the parameter caveat second. The brevity is a virtue structurally, even though the content it omits is substantial.

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?

For a 10-parameter mutation tool with no annotations, no output schema, and zero schema coverage, the definition is far too thin. An agent cannot determine result-writing behavior, join-type semantics, or how many nearest features are retained by default (max_features=5) without reading the raw schema.

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% across 10 parameters, so the description must compensate and it explains only max_distance's unit convention. Critical knobs such as how (default 'left'), columns, max_features, offset, and output_path are left entirely unexplained, leaving the agent to guess at left/right join semantics and result-writing behavior.

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?

States a specific verb and resource: joining each feature to the nearest feature in another file, which is distinct from the sibling spatial join tool that presumably uses predicate-based matching. It stops short of explicitly contrasting itself with sjoin_gpd, so the agent must infer the distinction from the word 'nearest' alone.

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 guidance on when to prefer this over sjoin_gpd or nearest_point_on_geometry, no prerequisites, and no mention of when a nearest-join is appropriate versus a predicate join. The only contextual hint is that max_distance is optional and expressed in CRS units, which helps interpretation but not tool selection.

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