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). A bot variable holds one value per bot: with includeValues it carries botValues [{ botId, botName, value }] for every bot of the application (value null = that bot has none yet); set one with update_variable data.botId. Variables marked secret stay redacted either way. Variables come in the order the variables list shows, scope by scope; move one with update_variable data.placeAfter / data.placeBefore. Use the returned ids in {{var|<id>}} references.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_variable_context"
  }
}

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.8/5.0
Behavior5/5

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

Beyond the readOnly/destructive annotations, the description discloses truncation detection via returned vs total, 500-character previews in list mode, full values only with variableId, secret variables staying redacted either way, bot-variable botValues semantics with null meaning 'none yet,' and the ordering/placement model tied to update_variable.

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 paragraph is dense and front-loaded with the two operating modes, then layers caveats. Some sentences drift into update_variable mechanics (placeAfter/placeBefore, data.botId), which is useful but slightly dilutes focus on this tool's own invocation.

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?

There is no output schema, and the description compensates by naming the response fields { variables, total, returned, truncated } and explaining how to interpret them. Combined with redaction and bot-value behavior, an agent has everything needed to call it correctly and interpret results.

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 cross-parameter meaning: variableId overrides scope/query/limit and yields a full value when combined with includeValues, and bot values are scoped per botId. It does not restate the limit clamping or applicationId key-prefix rules, which the schema already covers.

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 opening sentence names two specific modes with verb and resource: 'Search variable definitions by scope and keyword, or read one variable by id.' This lets an agent distinguish the list path from the single-fetch path immediately, and 'Read-only' sets the safety frame up front.

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 routing guidance is given: use variableId + includeValues to read a value fully 'before update_variable, which replaces the whole value,' omit query to list unfiltered, and leave includeValues off unless the data is needed. It also names an alternative read pattern and the reason to prefer it.

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.