Skip to main content
Glama

network_shortest_path_layer

Calculate the shortest or fastest route between two points on a line network layer using Dijkstra's algorithm. Supports one-way streets and speed fields for time-based routing.

Instructions

Find the shortest/fastest path between two points on your own line network layer.

Runs QGIS's native network-analysis algorithm (Dijkstra) on network_layer_id - the layer must already be in the project (roads, trails, etc.). start_point/end_point are [x, y] in that layer's CRS. strategy is "shortest" (default, geometric length) or "fastest" (needs speed_field, km/h, falling back to default_speed where empty). direction_field supports one-way networks if the layer has one. The resulting path is added to the project as a new line layer; only a length/id summary is returned here.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
strategyNoshortest
end_pointYes
toleranceNo
speed_fieldNo
start_pointYes
default_speedNo
direction_fieldNo
network_layer_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations provided, so description carries full burden. Discloses algorithm (Dijkstra), requirement for layer in project, output as new layer with only length/id returned. Does not detail error handling or performance limits.

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?

Two paragraphs, ~100 words, front-loaded with purpose. Every sentence provides essential information with no redundancy.

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?

Covers algorithm, parameters, output format, and key constraints. Could mention performance considerations or network size limits, but overall thorough given complexity and lack of annotations.

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 coverage is 0%, but description explains 7 of 8 parameters meaningfully (format, units, defaults). Only tolerance is omitted. Adds significant value beyond 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?

Clearly states 'Find the shortest/fastest path between two points on your own line network layer' with specific verb and resource. Distinguishes from sibling routing tools (e.g., route_osrm) by focusing on custom layers using Dijkstra.

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?

Explains prerequisites (layer in project, CRS), strategy choices, speed field requirements, and direction field for one-way networks. Lacks explicit exclusion versus alternatives, but context is clear.

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