Skip to main content
Glama

plot_variable

Render a variable as a bar or histogram directly in the web page. Auto-selects chart type, excludes missing codes by default, and supports survey weights for distributions.

Instructions

把一个变量画成图,图会直接显示在网页上。kind='auto' 时自动选择:类别型画条形图(用码值含义当标签),连续数值画直方图。缺失值编码默认排除。传 weight 参数可按抽样权重加权——调查数据展示总体分布时应该加权。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNo条形图最多显示几个类别
binsNo直方图分几组
kindNoauto / bar(条形图)/ histogram(直方图)auto
tableYes表名,如 final_HO_CSES(大小写敏感)
columnYes列名
schemaNoschema 名。省略时自动按表名解析
weightNo抽样权重列名
include_missingNo是否把缺失值编码也画进去(默认排除)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden, and it does disclose key defaults: missing-value codes are excluded by default, kind='auto' resolves to bar vs histogram by data type, and weight triggers weighted aggregation. It omits any permission/auth or size-limit behavior, keeping it short of a 5.

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

Conciseness4/5

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

Front-loaded with the core action, then the auto-selection rule, then defaults and the weight caveat. Every sentence carries information with little waste, though the auto/weight sentences are somewhat dense.

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?

An output schema exists so return values need no explanation, and the description covers the decisions an agent must make: chart type resolution, missing-value handling, and weighting. Nothing required to call it correctly is missing.

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, but the description adds genuine meaning beyond the schema for kind ('auto' resolution logic), weight (survey weighting semantics), and include_missing (default exclusion). This goes past merely restating the parameter list.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('把一个变量画成图') and explains the rendering target ('图会直接显示在网页上'). It distinguishes itself from sibling stats tools like variable_stats by being a visualizer, but never names a sibling explicitly, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides real conditional guidance for one parameter ('调查数据展示总体分布时应该加权'), but gives no guidance on when to reach for this tool over describe_table, variable_stats, or sample_rows. Usage context is implied rather than framed against alternatives.

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