Skip to main content
Glama

worktree_env

Read-only

Resolve shared build-cache environment variables for the current Git worktree, returning shell or JSON output for installs and builds.

Instructions

Resolve shared-cache environment variables for the current git worktree (cache dirs + hit-enabling flags). Use before running installs/builds in a worktree.

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": "worktree_env"
  }
}

Input Schema

NameRequiredDescriptionDefault
jsonNoReturn the raw variable map as JSON instead of shell syntax
shellNoShell syntax for the env text (default sh)
providersNoRestrict to these build-cache providers (default: all detected)
timeout_msNoEnvironment probe time budget in milliseconds (default 10000, max 30000)
workspace_pathNoAbsolute thread workspace directory; must map to this project. Omit only when the server cwd is the thread workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.15.1
    • addedInput schema / properties / timeout_ms
      Added value: +{
      +  "description": "Environment probe time budget in milliseconds (default 10000, max 30000)",
      +  "maximum": 30000,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Addedv0.13.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered; the description reinforces it by framing the tool as a resolver rather than a mutator. It adds little beyond that, omitting the probing behavior, the timeout budget implications, and that no state is changed. Adequate but not rich given the lower bar set by annotations.

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?

Two short sentences with the action-and-scope front-loaded and the usage cue second; nothing is padded. The trailing parenthetical is slightly terse but still earns its place by naming the payload.

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?

With no output schema, the description carries some return-value burden and does indicate the payload (cache dirs + hit-enabling flags), while the schema covers the json/shell output-format switch. For a read-only resolver it is nearly complete, missing only a note on what happens when no providers are detected.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all five parameters (json, shell, providers, timeout_ms, workspace_path) are already documented in the schema. The description adds no parameter-level detail, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb ('Resolve') plus a precise resource ('shared-cache environment variables for the current git worktree'), with a parenthetical clarifying the output payload. It does not name or distinguish itself from a potentially overlapping sibling such as env_facts, so an agent must infer the boundary.

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 second sentence gives explicit timing guidance ('Use before running installs/builds in a worktree'), which is genuinely actionable context. It stops short of naming alternatives or stating when not to use it (e.g., outside a git worktree).

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