Skip to main content
Glama

Analyze Weighted IBGE Distribution

ibge_microdata_weighted_distribution
Read-onlyIdempotent

Compute weighted distribution statistics and top-bracket shares from IBGE microdata Parquet views via a custom SQL query.

Instructions

Calculate weighted distribution summaries and top-bracket shares over local IBGE Parquet views.

Use this after converting microdata to Parquet when you need income, consumption, wealth, or other distribution statistics without hand-writing all aggregation SQL. Provide unitSql as a read-only SELECT/WITH query that returns a numeric value column, a numeric weight column, and optionally a group column. The tool ranks units by value, computes total weight/value/mean, group population and value shares, and top brackets such as top 1%, 5%, and 10%. Cutoff ties are allocated proportionally across groups.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewsYesNamed local Parquet views to create before calculating the distribution.
unitSqlYesRead-only SELECT/WITH query that returns one row per analytical unit with value, weight, and optional group columns.
maxGroupsNoMaximum group summaries to return. Defaults to 100 and is capped at 1000.
groupColumnNoOptional column name from unitSql used for group breakdowns, e.g. region or category.
topPercentsNoTop brackets as fractions, e.g. [0.01, 0.05, 0.1]. Defaults to [0.01, 0.05, 0.1].
valueColumnYesColumn name from unitSql containing the income, consumption, wealth, or other value to rank.
weightColumnYesColumn name from unitSql containing the survey/sample weight.
Behavior4/5

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

Annotations already declare readOnly, idempotent, and non-destructive. The description adds behavioral context: it creates views temporarily, ranks units, computes statistics, and handles ties proportionally. No contradiction with annotations. Adds useful detail beyond the safety profile.

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 three sentences, front-loading the purpose and then providing usage details. No wasted words; each sentence adds value. Structure is logical and efficient.

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

Completeness3/5

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

While the description covers main functionality and parameters, it lacks explicit output structure details (e.g., JSON format, column names) because no output schema exists. For a 7-parameter tool, it is fairly complete but could elaborate on return format and error constraints.

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 baseline is 3. The description adds meaning by explaining unitSql as a read-only query returning specific columns, and clarifying defaults for topPercents and maxGroups. This adds moderate value over the schema alone.

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 the tool computes weighted distribution summaries and top-bracket shares over local IBGE Parquet views. It specifies the input (unitSql) and outputs (total weight/value/mean, group shares, top brackets). This distinguishes it from sibling tools like generic query or profile tools.

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 explicitly states when to use: after converting microdata to Parquet when distribution statistics are needed without manual SQL. It implies non-use for other purposes and provides workflow context, though it does not name alternative sibling tools directly.

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/emmanueltsallis/ibge-microdata-mcp'

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