Skip to main content
Glama

OpenFactory

set_app_env

Upsert and/or delete env vars on an app in a single transaction.

Bumps app.env_version if any var actually changed; deploy_app picks up the new version on the next run (compare env_version to applied_env_version to see drift). At least one of set / delete required. Returns {env_version, redeploy_hint}.

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": {
      "app_id": "<app_id>"
    },
    "name": "set_app_env"
  }
}

Input Schema

NameRequiredDescriptionDefault
setNoUpsert dict of KEY → value. Keys must match ^[A-Z_][A-Z0-9_]{0,127}$ (uppercase + digits + underscore, ≤128 chars). Values ≤8 KiB. OPENFACTORY_ prefix reserved.
app_idYesApp ID (UUID from create_app).
deleteNoOptional list of KEY names to remove from the app's env.
api_keyNoMCP API key
session_tokenNoSession token

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does most of it: it discloses the mutation, the transactional all-or-nothing framing, the conditional side effect (env_version bumps only if a var actually changed), and the redeploy consequence. It omits permission/auth requirements and behavior on deleting a non-existent key, which matter for a mutation tool with zero annotation coverage.

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?

Front-loads the operation, then constraint, then side effects and return shape, with no filler sentences. The parenthetical about env_version/applied_env_version drift is dense but earns its place; formatting is slightly cramped with backtick-heavy prose.

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?

For a five-parameter mutation tool with an output schema, the description covers atomicity, the version-bump side effect, the deploy coupling, the input precondition, and the return shape. Nothing an agent needs to invoke it correctly is missing, given the schema documents the credentials and key constraints.

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 a genuine cross-parameter constraint not expressible in the schema: at least one of set/delete must be supplied even though only app_id is required. The per-parameter key format and size limits are already fully covered by the schema.

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?

Names two specific verbs (upsert, delete) against a specific resource (env vars on an app) with an atomicity qualifier ('single transaction'). The 'on an app' scoping implicitly separates it from the account-level sibling set_account_env, and it is clearly not a read tool like list_app_env/reveal_app_env.

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?

Gives a hard precondition ('At least one of set / delete required') and explains the downstream workflow: deploy_app picks up the bumped env_version on the next run, and drift is visible by comparing env_version to applied_env_version. It stops short of stating when to prefer this over set_account_env or when a redeploy is mandatory rather than deferred.

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.