Skip to main content
Glama

update_state

Saves decisions and context from the current session to a git branch state file, merging with prior memory to maintain project history across context resets.

Instructions

Updates the project memory with decisions made this session. Writes to the state file of the current git branch when the project is a git repository. Call this at the END of every session. Merges with existing state and does not erase previous memory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nextNoWhat to pick up in the next session.
avoidNoWhat failed and should not be repeated.
forceNoRecover from a state file that cannot be decrypted (corrupted or encrypted with an orphaned key). When true and the existing file fails to decrypt, the corrupted file is renamed to a '.corrupted-backup-<timestamp>' sibling instead of being read, and this call's data becomes the fresh state — nothing is merged in from the unreadable file, and nothing is deleted. Only set this after confirming the failure is persistent, not a transient lock from another process writing at the same moment.
contextNoWhat this project is and its current phase.
decisionsNoDecisions made this session.
preferencesNoCoding style, workflow, or communication preferences discovered.
project_pathNoAbsolute path to the project root (or worktree) to scope this state to. Always pass this explicitly when calling from an agent or worktree that is not the caller's own working directory — an omitted value falls back to this process's cwd, which can silently resolve to the wrong project/branch and collide with another process's state file.
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that it merges with existing state (non-destructive), operates on the current git branch, and the 'force' parameter's description details corruption recovery. It does not clarify behavior if the project is not a git repository, but overall provides good transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences of minimal length, each adding necessary information: purpose, git detail, and timing/merge behavior. No redundant or filler content.

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?

Given 7 optional parameters, no output schema, and no annotations, the description covers purpose, usage timing, and key behavioral aspects (merge, git). It is slightly ambiguous about non-git scenarios but is otherwise complete for a session-end memory update tool.

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 coverage is 100%, so baseline is 3. The description does not add additional meaning beyond the schema; it only provides overall context. The parameter descriptions in the schema are already detailed, so the description adds limited value for parameter understanding.

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 clearly states it updates project memory with decisions made this session, writes to the state file of the current git branch, and merges with existing state. This distinguishes it from siblings like get_state (read-only) or store_decision (which might store during session). The verb 'updates' and resource 'project memory' are specific.

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 description explicitly says 'Call this at the END of every session,' giving clear when-to-use guidance. It does not explicitly state when not to use or compare to siblings, but the timing instruction is strong. The merge behavior implies it's safe to call repeatedly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Fmarzochi/EGC'

If you have feedback or need assistance with the MCP directory API, please join our Discord server