Skip to main content
Glama

Codificar polilínea

polyline-encode
Read-onlyIdempotent

Codifica una lista de puntos con el algoritmo Encoded Polyline (precisión 5 o 6). Cuándo: hay que calcular coordenadas, distancias, rumbos o áreas a partir de puntos dados. No para: decodificar una cadena Encoded Polyline en puntos lat/lon (polyline-decode). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Encodes a list of lat/lon points with the Encoded Polyline Algorithm (precision 5 by default, 6 for OSRM/Valhalla). When: coordinates, distances, bearings or areas have to be computed from given points. Not for: decoding an Encoded Polyline string (polyline-decode). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
pointsYesPoints (array of object; required; at least 1 items).
precisionNoDecimal precision (integer; optional; default 5; min 1; max 7).

Output Schema

NameRequiredDescriptionDefault
polylineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / points / examples
      Added value: +[
      +  [
      +    {
      +      "lat": 38.5,
      +      "lon": -120.2
      +    },
      +    {
      +      "lat": 40.7,
      +      "lon": -120.95
      +    },
      +    {
      +      "lat": 43.252,
      +      "lon": -126.453
      +    }
      +  ]
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint=false, idempotentHint and destructiveHint=false, and the 'side effects/deterministic' lines largely restate them. However, the description adds real information the annotations do not cover: explicit limits (64 KB input, 1 s per call, 1 MB result) and the precision-6 OSRM/Valhalla convention.

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?

Each language section is tightly front-loaded with purpose first, followed by when/not-for, effects and limits. It is somewhat long because the same content is duplicated in ES and EN, which costs a point on strict size but does not bury the key information.

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

Completeness5/5

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

An output schema exists, so the description need not explain return values. It covers purpose, selection criteria, the sibling alternative, side effects, determinism, resource limits and precision guidance — everything an agent needs to invoke it correctly.

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?

Schema coverage is 100%, so the schema already documents both parameters; baseline is 3. The description earns a point by explaining what precision means in practice — 5 by default, 6 for OSRM/Valhalla — which the schema does not state. It does not describe edge behavior of out-of-range points beyond the schema's min/max, hence not a 5.

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?

States a specific verb and resource (encodes a list of lat/lon points with the Encoded Polyline Algorithm) and adds the default precision. It also explicitly names the sibling it is not (polyline-decode), so the agent can distinguish it without opening the schema.

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

Usage Guidelines5/5

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

Uses explicit 'When:' and 'Not for:' markers. It names the alternative (polyline-decode) and the condition that selects it (decoding a string into lat/lon). Nothing is left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources