Skip to main content
Glama

build_transform_and_save_weights

Build spatial weights from a point shapefile using queen, rook, distance band, or KNN methods, optionally apply a transformation, and save the weights to GAL or GWT format.

Instructions

Pipeline: Read shapefile, build spatial weights, optionally transform, and save to file.

Parameters:

  • data_path: Path to point shapefile or GeoPackage

  • method: 'queen', 'rook', 'distance_band', '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' (optional)

  • output_path: File path to save weights

  • format: 'gal' or 'gwt'

  • overwrite: Allow overwriting if file exists

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_pathYes
methodNoqueen
id_fieldNo
thresholdNo
kNo
binaryNo
transform_typeNo
output_pathNoweights.gal
formatNogal
overwriteNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations are provided, so description carries full burden. It describes the pipeline steps and mentions overwrite behavior, but lacks details on side effects like file permissions, error cases, or whether the original file is modified. The overwrite parameter is listed, but behavioral context is minimal.

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 concise with a clear pipeline statement followed by a parameter list. It is front-loaded with the overall purpose. No redundant sentences, but the parameter list is necessary given 10 parameters. Slightly longer than ideal but appropriate for complexity.

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 has 10 parameters, no annotations, and exists output schema, the description covers the pipeline, parameter details, and conditional requirements. It lacks guidance on method selection or error handling, but overall provides sufficient context for an agent to use the tool effectively.

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 description must compensate. It provides thorough explanations for all parameters, including conditional requirements (e.g., threshold required for distance_band, k for knn) and default values. This adds significant meaning beyond the schema's type and default info.

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 clearly states the tool as a pipeline that reads a shapefile, builds spatial weights, optionally transforms, and saves to file. It distinguishes itself from sibling tools like 'build_and_transform_weights' (which likely doesn't save) and 'weights_from_shapefile' (which might only build).

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

Usage Guidelines3/5

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

The description explains what the tool does but does not explicitly state when to use it vs alternatives. It implies use when saving is needed, but no direct comparison or when-not guidance is given. Siblings include many weight-building tools, so explicit differentiation would help.

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