Skip to main content
Glama

enaho_unir_modulos

Idempotent

Merge ENAHO modules at the desired level (household, person, or dwelling). Normalizes ID keys, reports row losses, and saves a parquet dataset with warnings for analysis.

Instructions

Une modulos aplicando las llaves del nivel pedido y guarda un parquet.

Es la herramienta central. Hace tres cosas que un merge a mano suele equivocar: elige la base correcta (el modulo mas desagregado manda), normaliza el tipo de las llaves (conglome puede venir como texto en un modulo y como entero en otro) y cuenta las filas perdidas en cada paso.

Lee el bloque pasos_union de la respuesta: una tasa de emparejamiento baja puede ser legitima (el modulo 05 solo cubre personas de 14 anios a mas) o puede ser un merge roto, y la diferencia importa.

Devuelve el nombre del dataset, su forma y sus advertencias. NO devuelve microdatos: para analisis libre abre el parquet con pandas.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
anioYes
nivelNoUnidad de analisis del resultado. 'persona' usa conglome+vivienda+hogar+codperso; 'hogar' omite codperso.hogar
cortesNoDepartamentos a apilar, en las encuestas que publican un archivo por departamento (cenagro, mapa-pobreza). Sin filtro se apilan todos, que es el dataset nacional.
salidaNoNombre del dataset resultante. Por defecto se autogenera.
modulosYesModulos del MISMO anio. Combinaciones tipicas: ['01','34'] a nivel hogar, ['02','05','34'] a nivel persona.
encuestaNoEncuesta del INEI sobre la que operar. Por defecto 'enaho'. Valores: enaho, enaho-panel, endes, enapres, enut, enares, ena, epen-departamentos, epen-ciudades, epen-lima, epe-lima, enapref, enco, cenagro, mapa-pobreza. Cada encuesta tiene sus propias llaves de union y su propio factor de expansion; no se pueden mezclar entre si.
descargar_si_faltaNoDescarga los modulos que no esten en el cache.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description goes well beyond the annotations. It discloses internal merge behavior (base selection, key type normalization, row loss counting), explains the `pasos_union` output block, and warns about interpreting low match rates. This is substantial behavioral context that the annotations (readOnlyHint, destructiveHint, idempotentHint) do not cover. No contradiction found.

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 well-structured and front-loaded. It opens with the core purpose, then explains three critical merge behaviors, then guides the user on interpreting output, and finishes with a clear caveat about microdata. Every sentence carries value and there is no redundancy.

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?

Given the tool's central role, its 7 parameters, and the presence of an output schema, the description is remarkably complete. It explains what is returned (name, shape, warnings), what is not returned (microdata), how to interpret the `pasos_union` block, and why certain match rates are legitimate. The sibling context is also handled by identifying this as the central merge tool.

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 description coverage is high (86%), so the baseline is 3. The description adds meaningful context to parameters like `nivel` (applying the level's keys) and `modulos` (same-year requirement, typical combos), as well as explaining why key normalization matters. It doesn't detail every parameter, but the schema handles those well.

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 begins with a clear verb and resource: 'Une modulos aplicando las llaves del nivel pedido y guarda un parquet' (merges modules applying the keys and saves a parquet). It further distinguishes this tool from siblings by detailing its unique merge logic (choosing the most disaggregated base, normalizing key types, counting lost rows) and positioning it as 'la herramienta central'.

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?

The description establishes when to use this tool (for merging modules) and explicitly states a non-usage: 'NO devuelve microdatos: para analisis libre abre el parquet con pandas.' This provides a clear context and a 'when not to' for microdata access, though it doesn't name specific alternative sibling tools.

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/AnderMC66/enaho-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server