Skip to main content
Glama
alexrobl
by alexrobl

render_map

Create an interactive HTML map from vector data, combining multiple layers with toggles, basemap, labels, and legend. Use it when users need a dynamic map to pan, zoom, and inspect features.

Instructions

Mapa DINÁMICO interactivo con Leaflet: pan, zoom, clic para inspeccionar atributos, VARIAS capas con control on/off (extra_layers), basemap configurable, simbología categorized/graduated (style), etiquetas (label_by), leyenda, escala y coordenadas del cursor.

Úsala cuando el usuario pida un mapa dinámico/interactivo, quiera COMBINAR VARIAS capas, pida un basemap específico o quiera el mapa como archivo HTML. Para la vista rápida de UNA sola capa en el chat usa view_layer; para una imagen estática export_map_image; para un producto formal con layout export_map_cartographic. No construyas mapas a mano con pyshp/pyproj/folium/Leaflet ni artefactos — NUNCA es necesario: esta herramienta embebe los datos server-side sin gastar contexto.

Genera DOS salidas: la vista inline del chat (los tiles externos están bloqueados en el sandbox, así que dibuja una grilla de coordenadas como fondo de respaldo) y un HTML de ALTA FIDELIDAD guardado en disco, donde el basemap sí carga al abrirlo en un navegador.

Args: path: Ruta al archivo o directorio espacial. layer: Nombre de la capa (None = primera capa). limit: Máximo de features a renderizar (default 2000). color_by: Campo para colorear features por categoría. where: Filtro SQL OGR. bbox: Extensión espacial [xmin, ymin, xmax, ymax]. source_crs: CRS a asumir SOLO si el archivo no define uno (ej. "EPSG:3116"). Se reproyecta automáticamente a WGS84. style: Estilo avanzado categorized/graduated, mismo formato que export_map_image ("field" tiene precedencia sobre color_by). label_by: Campo para etiquetar features (tooltip fijo si ≤30 features; al pasar el cursor si son más). extra_layers: Capas adicionales bajo la principal, cada una con checkbox on/off en el control de capas. Entrada: dict con path (requerido), layer, limit (default 10000), where (filtro SQL OGR sobre ESA capa), color (IMPORTANTE: explícito y distinto por capa), alpha, linewidth, linestyle ("--" discontinua, ":" punteada), label, markersize, crs (solo si el archivo no define CRS). Para categorizar una capa extra por campo (color_by/style) usa export_map_image o export_map_cartographic. basemap: URL de basemap alternativo (raíz de ArcGIS MapServer tileado o plantilla XYZ {z}/{x}/{y}), igual que en los exports. Default Esri World Light Gray Canvas. Solo visible fuera del sandbox. markersize: Tamaño de puntos de la capa principal en pt² (semántica de los exports); default automático según cantidad de puntos. output_path: Ruta del HTML de alta fidelidad. Default: junto al archivo fuente como "{capa}_dynamic.html".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bboxNo
pathYes
layerNo
limitNo
styleNo
whereNo
basemapNo
color_byNo
label_byNo
markersizeNo
source_crsNo
output_pathNo
extra_layersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.2.9
    • addedInput schema / properties / basemap
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Basemap"
      +}
    • addedInput schema / properties / extra_layers
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Extra Layers"
      +}
    • addedInput schema / properties / label_by
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Label By"
      +}
    • addedInput schema / properties / markersize
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "number"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Markersize"
      +}
    • addedInput schema / properties / output_path
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Output Path"
      +}
    • addedInput schema / properties / source_crs
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Source Crs"
      +}
    • addedInput schema / properties / style
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Style"
      +}
    • addedOutput schema / $defs
      Added value: +{
      +  "Annotations": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "audience": {
      +        "anyOf": [
      +          {
      +            "items": {
      +              "enum": [
      +                "user",
      +                "assistant"
      +              ],
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Audience"
      +      },
      +      "priority": {
      +        "anyOf": [
      +          {
      +            "maximum": 1,
      +            "minimum": 0,
      +            "type": "number"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Priority"
      +      }
      +    },
      +    "title": "Annotations",
      +    "type": "object"
      +  },
      +  "BlobResourceContents": {
      +    "additionalProperties": true,
      +    "description": "Binary contents of a resource.",
      +    "properties": {
      +      "_meta": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Meta"
      +      },
      +      "blob": {
      +        "title": "Blob",
      +        "type": "string"
      +      },
      +      "mimeType": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Mimetype"
      +      },
      +      "uri": {
      +        "format": "uri",
      +        "minLength": 1,
      +        "title": "Uri",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "uri",
      +      "blob"
      +    ],
      +    "title": "BlobResourceContents",
      +    "type": "object"
      +  },
      +  "EmbeddedResource": {
      +    "additionalProperties": true,
      +    "description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
      +    "properties": {
      +      "_meta": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Meta"
      +      },
      +      "annotations": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/Annotations"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "resource": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/TextResourceContents"
      +          },
      +          {
      +            "$ref": "#/$defs/BlobResourceContents"
      +          }
      +        ],
      +        "title": "Resource"
      +      },
      +      "type": {
      +        "const": "resource",
      +        "title": "Type",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "resource"
      +    ],
      +    "title": "EmbeddedResource",
      +    "type": "object"
      +  },
      +  "TextContent": {
      +    "additionalProperties": true,
      +    "description": "Text content for a message.",
      +    "properties": {
      +      "_meta": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Meta"
      +      },
      +      "annotations": {
      +        "anyOf": [
      +          {
      +            "$ref": "#/$defs/Annotations"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null
      +      },
      +      "text": {
      +        "title": "Text",
      +        "type": "string"
      +      },
      +      "type": {
      +        "const": "text",
      +        "title": "Type",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "type",
      +      "text"
      +    ],
      +    "title": "TextContent",
      +    "type": "object"
      +  },
      +  "TextResourceContents": {
      +    "additionalProperties": true,
      +    "description": "Text contents of a resource.",
      +    "properties": {
      +      "_meta": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Meta"
      +      },
      +      "mimeType": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "title": "Mimetype"
      +      },
      +      "text": {
      +        "title": "Text",
      +        "type": "string"
      +      },
      +      "uri": {
      +        "format": "uri",
      +        "minLength": 1,
      +        "title": "Uri",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "uri",
      +      "text"
      +    ],
      +    "title": "TextResourceContents",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / result / items
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/TextContent"
      +    },
      +    {
      +      "$ref": "#/$defs/EmbeddedResource"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / result / type
      Previous value: -"string"New value: +"array"
  2. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses that external tiles are blocked in the sandbox so a coordinate-grid fallback is drawn, that a high-fidelity HTML is saved to disk, that data is embedded server-side to save context, and that basemaps only load outside the sandbox. It also explains auto-reprojection to WGS84 and the two-output behavior.

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?

Although long, the description is highly information-dense and earns its length given 13 parameters and complex nested options. It is front-loaded with purpose and usage guidance, then uses a structured Args list. Every sentence adds decision-relevant detail rather than fluff.

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?

For a complex 13-parameter tool with one required parameter, nested objects, sandbox caveats, and multiple output artifacts, the description is remarkably complete. It covers inputs, output behavior, file paths, basemap constraints, and alternatives, while the presence of an output schema removes the need to describe return values in prose.

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 the description must fully compensate, and it does: every parameter receives meaningful semantics, including defaults, formats, precedence rules ('field' tiene precedencia sobre color_by), SQL filter behavior, bbox coordinate order, and detailed nested fields for extra_layers. This goes far beyond the bare input 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?

The description clearly states a specific verb and resource: rendering an interactive dynamic Leaflet map from a spatial file or directory, with detailed capabilities (multiple layers, basemap, symbology, labels). It also explicitly distinguishes itself from siblings such as view_layer, export_map_image, and export_map_cartographic.

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?

It gives explicit when-to-use guidance ('Úsala cuando el usuario pida un mapa dinámico/interactivo, quiera COMBINAR VARIAS capas, pida un basemap específico o quiera el mapa como archivo HTML') and names alternatives with their conditions. It also tells the agent not to hand-build maps with low-level libraries, which is strong routing guidance.

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