Skip to main content
Glama
alexrobl
by alexrobl

view_layer

Visualize a single spatial layer directly in chat with an inline JPEG image and interactive HTML map, giving immediate visibility of your GIS data.

Instructions

Vista rápida de UNA capa, mostrada directamente en el chat. Úsala cuando el usuario pida "ver", "visualizar" o "mostrar" una capa, un "mapa básico" o una vista simple — sin multicapa, sin basemap y sin archivos.

Devuelve DOS representaciones de la misma vista, sin depender de detectar el cliente MCP: una IMAGEN estática (JPEG inline, sin basemap/escala/norte) que se muestra en cualquier cliente — es la garantía real de visibilidad, incluyendo Claude Desktop/Cowork, que no renderiza recursos HTML — y, además, un mapa HTML interactivo (pan/zoom, popups de atributos al clic, grilla de coordenadas de fondo) que solo se ve inline en clientes que renderizan recursos text/html como iframe (ej. claude.ai); en los que no, llega como texto/JSON crudo y debe ignorarse — no es un error de datos. NUNCA construyas esta vista a mano con HTML/folium/Leaflet ni artefactos: esta herramienta embebe los datos server-side sin gastar contexto.

Escalar a otra herramienta cuando el usuario pida más: varias capas, basemap o archivo HTML → render_map · imagen con basemap/escala/norte/ disco → export_map_image · producto formal con layout → export_map_cartographic.

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). markersize: Tamaño de puntos en pt² (semántica de los exports); default automático según cantidad de puntos.

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.10

TDQS

A5/5.0
Behavior5/5

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

No annotations are present, so the description carries full burden, and it delivers: it discloses the dual return (static JPEG plus HTML map), client-dependent rendering (Claude Desktop/Cowork vs claude.ai), and that raw HTML/JSON should be ignored rather than treated as an error. It also warns against hand-building the view and explains server-side embedding to save context.

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?

The description is long but densely packed and clearly structured: purpose, behavior, escalation routing, then Args. No filler; each paragraph and argument line carries operational information required for correct use.

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 10-parameter dual-output tool with no annotations, the description covers what the tool does, when to choose it, what it returns, how clients render it, how to escalate, and semantics for every argument. The output schema covers return structure, so nothing essential is missing.

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%, and the Arg list fully compensates: each of the 10 parameters gets semantic detail beyond the schema, e.g., source_crs applies only if the file lacks a CRS and reprojects to WGS84; label_by changes tooltip behavior based on feature count; markersize is in pt² with automatic default. This is high-value parameter documentation.

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 action and resource: 'Vista rápida de UNA capa, mostrada directamente en el chat.' It explicitly excludes multi-layer, basemap, and file cases, and names escalation siblings, so it is distinguishable from render_map/export_map_image/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?

Gives explicit trigger phrases ('ver', 'visualizar', 'mostrar') and exclusions ('sin multicapa, sin basemap y sin archivos'). It then names the exact sibling to escalate to for multi-layer/basemap, image with basemap/scale/north, and formal layout. This is textbook when-to-use vs alternatives.

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