Skip to main content
Glama

Brapi Find Variables

brapi_find_variables
Read-only

Find observation variables (traits) by name, trait class, ontology term, or free-text query. Free-text queries are ranked against the returned set and may resolve to ontology URIs when the server advertises them. When the upstream total exceeds loadLimit, the full result set is materialized as a dataframe — query it with brapi_dataframe_query (SQL).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cropNoFilter by common crop name (single value).
textNoFree-text query. Ranks the **full upstream union** (the spilled dataframe when one is produced, otherwise the first page) via the ontology resolver, then fills the in-context window up to loadLimit with matches first and unmatched rows for context. Use exact filters (`variables`, `variableNames`, `variablePUIs`, `traitClasses`, `ontologies`) to actually narrow the upstream pull. Differs from `brapi_find_germplasm.text`, which drops unmatched rows.
aliasNoConnection alias registered via brapi_connect. Omit to read the connection registered under alias `default` — i.e. a prior brapi_connect call that did not specify an alias. Calls that used a non-default alias must pass that same alias here.
scalesNoFilter by scaleDbIds.
methodsNoFilter by methodDbIds.
studiesNoFilter by studyDbIds.
loadLimitNoCap on rows returned inline. Omit for the deployment default. Rows beyond the cap land in a dataframe; query with brapi_dataframe_query (SQL) instead of paging row-by-row.
variablesNoFilter by observationVariableDbIds.
ontologiesNoFilter by ontologyDbIds.
extraFiltersNoExtra BrAPI filters forwarded verbatim. Valid keys vary by endpoint; brapi_describe_filters enumerates them. Named params on this tool take precedence on conflict.
traitClassesNoFilter by trait class.
variablePUIsNoFilter by persistent ontology URIs.
variableNamesNoFilter by exact observationVariableNames.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
aliasNoAlias of the registered BrAPI connection the call used.
errorNoPresent when the call failed. Absent on success.
noticeNoGuidance when no rows were returned — how to broaden filters or retry.
hasMoreNoTrue when more rows exist beyond the returned set.
resultsNoObservation variable rows returned in-context (up to loadLimit). Rows matching `text` are promoted to the top when the free-text query produces candidates.
warningsNoAdvisory messages (filter overrides, partial data, capability gaps).
dataframeNoDataframe handle when the full result set was materialized as a dataframe. Query it with brapi_dataframe_query (SQL).
totalCountNoTotal rows reported by the server.
distributionsNoValue frequency per field across the full result set.
returnedCountNoLength of results[].
appliedFiltersNoThe final filter map sent to the server (named + extraFilters).
refinementHintNoSuggested next-step query refinement when the result set is large.
ontologyCandidatesNoTop ranked candidates from the free-text query (if any). Empty when `text` was not supplied.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The description goes well beyond the readOnlyHint/openWorldHint annotations by disclosing ranking semantics, ontology-URI resolution when advertised, and the dataframe materialization behavior for large result sets. This is exactly the kind of non-obvious runtime behavior an agent needs to predict before calling the tool.

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 two sentences with no filler. The first sentence establishes the tool's purpose, and the second covers the most important behavioral caveat. It is front-loaded and every clause earns its place.

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 complexity (13 optional parameters, nested objects) and the existence of a full schema and output schema, the description covers the essential selection and invocation knowledge: search modes, overflow handling, and the post-query path. No critical behavioral gap remains for an agent to safely and correctly use the 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 coverage is 100%, so the baseline is 3, but the description adds meaningful parameter-level meaning: free-text queries are ranked against the returned set, and loadLimit triggers spillover to a queryable dataframe. It does not restate the schema; it explains behavioral consequences that the schema alone does not convey.

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 names a specific resource ('observation variables (traits)') and the exact search dimensions: name, trait class, ontology term, and free-text query. This clearly distinguishes it from siblings like brapi_find_observations and brapi_find_germplasm without ambiguity.

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 gives concrete guidance on when free-text behavior differs from exact filters and instructs the agent to use brapi_dataframe_query when the result set spills beyond loadLimit. It does not explicitly list when not to use this tool relative to every sibling finder, but the conditional guidance is clear and actionable.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.