Skip to main content
Glama

variable_save

Destructive

Saves a variable for AI agents when the user asks to keep a value: an access, a token, an address or an environment setting. A secret (secret) is stored encrypted and is never returned in responses. If a variable with the same level, scope, path and key exists, the passed fields are replaced. Levels company, project and repository require memory:moderate; user and token are the user's own. With path the value is the file /run/agent/vars// on the agent VM, without path it is the environment variable key. A secret for an AI agent employee is better passed from a file on the VM than in value, which goes through the model context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "level": "<level>",
      "key": "<key>",
      "value": "<value>"
    },
    "name": "variable_save"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesEnvironment variable or file name.
descNoWhy and how it is used; shown to agents.
jobsNoKinds of work that need the variable; empty - all.
pathNoFile directory without a leading /.
typeNoDefaults to string.
levelYesScope: company, project, repository; user - the user's own; token - the token of this connection.
titleNoTitle: what it is.
valueYesValue: number - a number, json - valid JSON, binary - base64. Empty: a new variable is created unfilled, an existing one keeps its value. A new value of an existing variable erases the previous one with no way to restore it, so it changes only at the user's direct request.
secretNotrue - a secret: stored encrypted, the value is not shown.
userIDNoFor level = user: an AI agent employee of the company - its variable; requires company:agents.
projectIDNoProject ID, for level = project.
allCompaniesNoFor level = user: true - in all of the user's companies; by default only in this one.
repositoryIDNoRepository ID, for level = repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / userID
      Added value: +{
      +  "description": "For level = user: an AI agent employee of the company - its variable; requires company:agents.",
      +  "format": "uuid",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / value / description
      Previous value: -"Value: number - a number, json - valid JSON, binary - base64. Empty: a new variable is created unfilled, an existing one keeps its value."New value: +"Value: number - a number, json - valid JSON, binary - base64. Empty: a new variable is created unfilled, an existing one keeps its value. A new value of an existing variable erases the previous one with no way to restore it, so it changes only at the user's direct request."
  3. Changed1 schema field changed
    • changedInput schema / properties / value / description
      Previous value: -"Value: number - a number, json - valid JSON, binary - base64."New value: +"Value: number - a number, json - valid JSON, binary - base64. Empty: a new variable is created unfilled, an existing one keeps its value."
  4. Changed2 schema fields changed
    • changedInput schema / properties / jobs / items / enum
      Previous value: -[
      -  "analysis",
      -  "dev",
      -  "qa",
      -  "devops",
      -  "review",
      -  "design"
      -]New value: +[
      +  "analysis",
      +  "dev",
      +  "qa",
      +  "devops",
      +  "review",
      +  "design",
      +  "marketing"
      +]
    • changedInput schema / properties / jobs / maxItems
      Previous value: -6New value: +7
  5. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=false and destructiveHint=true; the description goes well beyond them by explaining that secrets are stored encrypted and never returned in responses, that fields of an existing variable are replaced on matching level/scope/path/key, that a value overwrite is irreversible, and that value passes through model context. It also discloses the memory:moderate and company:agents permission prerequisites.

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 critical facts — destructive replacement, secret handling, level permissions — appear early, and there is no filler. Individual sentences are long and clause-heavy (the level/path sentence packs two distinct rules), which slightly blunts scanability.

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?

For a 13-parameter mutation tool with no output schema, the description covers the highest-risk semantics: irreversibility, encryption of secrets, permission requirements per level, and the path-vs-env-var distinction. Return behavior is not described, but annotations and schema carry enough of the remainder that nothing essential for a correct call 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?

With 100% schema coverage the baseline is 3, and the description earns credit by explaining that path resolves the value to the file /run/agent/vars/<path>/<key> on the agent VM while omitting path makes it an environment variable, plus the differing ownership of user and token levels. It leaves several parameters (jobs, title, desc, type, allCompanies) entirely to the schema, so it is strong but not exhaustive.

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 opens with a specific verb plus resource ('Saves a variable for AI agents') and immediately scopes it with concrete examples of what a variable is (access, token, address, environment setting), which separates it cleanly from the read-side sibling variable_read without naming it.

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 a clear trigger condition ('when the user asks to keep a value') and adds a comparative recommendation — a secret for an agent employee is better passed via a file on the VM than through the value field. It stops short of stating when NOT to use this tool or naming an alternative sibling explicitly.

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.

Resources