Skip to main content
Glama

transition_matrix

Compute intergenerational mobility transition matrices for education, occupation, or wealth. Returns row percentages, summary statistics, and mobility indices with optional standard errors.

Instructions

Compute an intergenerational mobility transition matrix.

This is the core analysis tool for social mobility research.

Args: dimension: Type of mobility to analyze. - "education": Educational mobility (4x4 matrix). Origin = max(father, mother) education; Destination = respondent education. - "occupation": Occupational class mobility. Origin = father's class; Destination = respondent's class. - "wealth": Wealth quintile mobility (5x5 matrix). Based on PCA wealth index from household assets (origin vs current). filter: Optional filter expression. Examples: "sexo == 2" (women only), "cohorte == 1" (ages 25-34), "region_14 == 5" (Southern region of origin). by: Optional grouping variable to produce separate matrices. Examples: "sexo" (by gender), "region_14" (by region of origin), "cohorte" (by age cohort). origin_category: Optional origin quintile/category to filter. Example: 1 for Q1 (poorest) in wealth, or 1 for "Primaria o menos" in education. Returns only the destination distribution for that origin. include_se: If True, compute Taylor-linearized standard errors and 95% confidence intervals for each matrix cell.

Returns markdown transition matrix with row percentages (origin -> destination), summary statistics, formal mobility indices, and optionally standard errors.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dimensionNoeducation
filterNo
byNo
origin_categoryNo
include_seNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description must disclose behavior fully. It explains the tool computes a matrix, returns markdown with row percentages, summary statistics, and optionally standard errors. It does not mention side effects, but as a read-only computation this is acceptable. However, it could note that it does not modify data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with bullet points and a clear args list, but it is somewhat verbose. The first sentence is redundant with the title, and the docstring format includes parameter repeated from the schema. It could be trimmed without losing clarity.

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 5 parameters, 0% schema coverage, and no annotations, the description is thorough. It covers all parameters with examples, explains the output (markdown matrix with indices and standard errors), and mentions return values without relying on an output schema. This is sufficient for correct agent invocation.

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 compensate, and it does excellently. For each parameter it provides detailed explanations and examples (e.g., dimensions with matrix sizes, filter strings, grouping variables). This adds immense value beyond the bare schema, which only lists names and types.

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 explicitly states the tool computes an intergenerational mobility transition matrix, using specific verbs like 'compute' and 'analyze'. It also clarifies it is the 'core analysis tool for social mobility research', distinguishing it from sibling tools like 'visualize_mobility'.

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 positions the tool as the primary analysis tool for mobility research, providing clear examples for parameters like 'filter' and 'by'. However, it does not specify when not to use this tool versus alternatives like 'tabulate' or 'visualize_mobility', leaving some ambiguity.

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/Lalitronico/emovi-mcp'

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