Skip to main content
Glama

build_and_transform_weights

Construct and transform spatial weight matrices from point datasets. Supports contiguity (queen, rook), distance-based, and KNN methods with row, variance, binary, or other transformations.

Instructions

Build and transform spatial weights in one step.

Parameters:

  • data_path: Path to point shapefile or GeoPackage

  • method: 'queen', 'rook', 'distance_band', or 'knn'

  • id_field: Optional field name for IDs

  • threshold: Distance threshold (required if method='distance_band')

  • k: Number of neighbors (required if method='knn')

  • binary: True for binary weights, False for inverse distance (DistanceBand only)

  • transform_type: 'r', 'v', 'b', 'o', or 'd'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_pathYes
methodNoqueen
id_fieldNo
thresholdNo
kNo
binaryNo
transform_typeNor

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

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

No annotations provided, so description must cover behavioral aspects. It describes building and transforming weights and parameter details but does not disclose what the output is (e.g., returns a pysal weights object), side effects, or permissions. The output schema exists but is not referenced in the description.

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?

The description is well-organized with a clear list of parameters and explanations. It is informative but slightly lengthy; could be tightened by removing redundant default value notes. Still, it front-loads the core action and uses bullet points effectively.

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 7 parameters, no schema descriptions, and no annotations, the description covers parameter semantics well but omits the tool's return behavior (despite existence of output schema) and any prerequisites (e.g., valid file path). This gap reduces completeness for an agent deciding to invoke the tool.

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

Parameters4/5

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

Input schema has 0% description coverage, so the description adds crucial meaning by explaining each parameter, including conditional requirements (e.g., threshold for distance_band). It specifies allowed methods and transform types. However, it lacks examples or more detailed constraints for enum-like parameters.

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 explicitly states it builds and transforms spatial weights in one step, with clear verb ('build_and_transform'), resource ('weights'), and lists parameters. It distinguishes from siblings like 'weights_from_shapefile' (only build) and 'build_transform_and_save_weights' (build and transform then save).

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?

No explicit guidance on when to use this tool versus alternatives. It mentions 'in one step' but does not compare with separate build and transform tools or other siblings like 'distance_band_weights' or 'knn_weights'. No when-not-to-use or prerequisite conditions are given.

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/mahdin75/gis-mcp'

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