Skip to main content
Glama

find_variables

Search variable metadata by semantic English keywords to locate variables across surveys, sections, and levels. Provide several synonyms to match definitions, labels, and value labels.

Instructions

【找变量的主要工具】按语义搜索整个数据库的变量元数据(变量定义、问卷原文、变量标签、值标签)。 ★ 调用前必须把概念展开成多个英文同义词——元数据是英文的,中文关键词搜不到任何东西,而且同一概念在不同调查里叫法不同。 例:使用者问「有没有教育年限相关的变量」,应传 keywords=["education","schooling","grade","attainment","years attended","diploma","degree"],这样才能同时命中 years_attended_school 和 highest_education_level。 宁可多给同义词也不要少给。搜索自带词干还原,不必列单复数词形。第一次结果不理想就换一批同义词再搜,不要直接说没有。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNo限定层级:canonical(协调变量,最可靠)/ question(问卷原文)/ source(原始列)
limitNo返回多少条
surveyNo限定调查:cses / dhs / mng_hses / mng_lfs
sectionNo限定 section,如 ED / WM / HO
keywordsYes英文同义词列表,3-10 个。必须是英文,可以是词组

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations present, the description carries the behavioral burden and does so reasonably well: it discloses that the metadata index is English-only, that Chinese keywords return nothing, that stemming is applied, and that iterative re-querying is expected. It does not discuss result ranking, pagination, or cost/latency, which are minor gaps for a search tool.

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?

The content is front-loaded with a bracketed role marker and a ★ callout for the critical keyword rule, and each sentence adds something (language constraint, example, stemming, retry policy). It is somewhat long, and the worked example could be tightened, but it does not feel padded.

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

Completeness4/5

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

An output schema exists, so the description needn't explain return values, and it covers purpose, keyword construction, and retry behavior adequately for a search tool. The main omission is disambiguation from the similarly named search_metadata sibling, which leaves the agent to guess which search surface to use.

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 already 100%, so the baseline is 3, but the description materially adds to the keywords parameter: the concept-expansion strategy, the 3-10 synonym count intent, and a worked example mapping a natural-language question to concrete terms. This goes beyond restating the schema by explaining what a good keyword set looks like.

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?

The description opens with a bracketed label identifying this as the primary tool for finding variables and specifies semantic search over variable metadata (definitions, questionnaire text, labels, value labels) across the whole database. The verb+resource+scope are all clear. However, it never names the very similar sibling search_metadata, so the boundary between the two tools is left for the agent to infer.

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?

It gives strong, actionable guidance on how to invoke the tool — expand concepts into multiple English synonyms, prefer over-supplying, rely on stemming, and re-query with new synonyms rather than reporting no results. What it lacks is explicit routing: it does not state when to prefer this over search_metadata, run_query, or variable_stats, so no alternative-selection criteria are given.

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