Skip to main content
Glama

get_variable_context

Read-only

Search variable definitions by scope and keyword, or read one variable by id. Read-only. Returns { variables, total, returned, truncated } — compare returned against total to detect a cut-off result set and re-call with a higher limit. Values are withheld unless includeValues is true; in a list each value is cut to a 500-character preview, while variableId + includeValues returns that one value in full (read it this way before update_variable, which replaces the whole value). Variables marked secret stay redacted either way. Use the returned ids in {{var|<id>}} references.

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum variables to return. Defaults to 30; values above 50 are clamped to 50.
queryNoCase-insensitive substring filter matched against the variable name, full path, description, type, and scope. Omit to list without filtering.
scopeNoRestrict to one variable scope. Defaults to "all".
variableIdNoRead exactly this variable (its id or persistentId). With includeValues=true the value comes back in full, not as a preview. scope, query and limit are ignored.
applicationIdNoApplication (workspace) id. Optional: an application-scoped key (app_...) defaults to its own application, but a personal key (usr_...) has no default and omitting it fails with MCP_APPLICATION_REQUIRED. Call list_applications to get the id.
includeValuesNoSet true to include stored values: previewed to 500 characters in a list, in full with variableId. Defaults to false — leave it off unless you need the data, since values may hold personal data. Secret variables remain redacted regardless.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / includeValues / description
      Previous value: -"Set true to include stored values, each previewed to 500 characters. Defaults to false — leave it off unless you need the data, since values may hold personal data. Secret variables remain redacted regardless."New value: +"Set true to include stored values: previewed to 500 characters in a list, in full with variableId. Defaults to false — leave it off unless you need the data, since values may hold personal data. Secret variables remain redacted regardless."
    • addedInput schema / properties / variableId
      Added value: +{
      +  "description": "Read exactly this variable (its id or persistentId). With includeValues=true the value comes back in full, not as a preview. scope, query and limit are ignored.",
      +  "type": "string"
      +}
  2. Changed5 schema fields changed
    • addedInput schema / properties / applicationId / description
      Added value: +"Application (workspace) id. Optional: an application-scoped key (app_...) defaults to its own application, but a personal key (usr_...) has no default and omitting it fails with MCP_APPLICATION_REQUIRED. Call list_applications to get the id."
    • addedInput schema / properties / includeValues / description
      Added value: +"Set true to include stored values, each previewed to 500 characters. Defaults to false — leave it off unless you need the data, since values may hold personal data. Secret variables remain redacted regardless."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum variables to return. Defaults to 30; values above 50 are clamped to 50."
    • addedInput schema / properties / query / description
      Added value: +"Case-insensitive substring filter matched against the variable name, full path, description, type, and scope. Omit to list without filtering."
    • addedInput schema / properties / scope / description
      Added value: +"Restrict to one variable scope. Defaults to \"all\"."
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare the read-only/non-destructive profile, but the description adds substantial context beyond them: values are withheld by default, list values are truncated to 500 characters, secrets stay redacted regardless, and the result set can be cut off. The truncation-detection recipe (compare returned against total) is behavior an agent could not infer from the schema.

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?

Dense but front-loaded: purpose, return shape, truncation handling, value semantics, secrets, and reference syntax in order of likely need. Five clauses is near the ceiling, and a couple of details (secret redaction, personal data) are stated twice across description and schema, but nothing is wasted.

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?

There is no output schema, so the description carries the return contract itself and does so well ({ variables, total, returned, truncated }). The only residual gap is that it doesn't describe the shape of individual variable objects (id, name, path, type, scope), which matters for assembling {{var|<id>}} references.

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 a baseline of 3 applies, but the description adds cross-parameter meaning the schema states only partially: variableId + includeValues yields the full value while a list yields previews, and scope/query/limit are ignored in single-read mode. It also flags the personal-data tradeoff of includeValues.

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 gives a specific verb and resource plus both operating modes ('search variable definitions by scope and keyword, or read one variable by id'), which no sibling tool covers. It also implicitly distinguishes itself from update_variable by naming that tool as the mutation counterpart.

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

Usage Guidelines5/5

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

Explicit when-to-use guidance is present for every mode: omit query to list, use variableId to read one, set includeValues only when the data is needed, and re-call with a higher limit when returned < total. It also prescribes a workflow ('read it this way before update_variable'), which is exactly the kind of routing an agent needs.

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.