Skip to main content
Glama

update_state

Persist session decisions to project memory to prevent data loss. Merges new insights with existing state, recording next steps, preferences, and prior failures for continuity across sessions.

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.
scopeNoWhere to write. 'project' (default) scopes to the current project/branch. 'global' writes to the user-wide memory shared across all projects (~/.egc/global/state.md); use it only for transversal preferences and lessons the user wants everywhere, never for project-specific state.
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.
Behavior3/5

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

With no annotations provided, the description carries the transparency burden. It discloses that it writes to the current git branch's state file, merges with existing state, and does not erase previous memory. However, it omits behavioral nuances like the force-recovery mode, global scope implications, or project_path fallback risks, which are only visible in the schema.

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 long, front-loaded with the primary action, and every sentence contributes distinct value. 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?

The tool has 8 parameters and no output schema, but the description plus schema together cover behavior and parameter semantics well. The missing return value information is less critical for a write-focused tool, although a brief note on what the tool returns would have made it fully complete.

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 each parameter already has meaningful definitions. The description adds no parameter-specific details beyond the schema, which is acceptable but does not elevate the score beyond the baseline.

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 the tool updates project memory with session decisions, using the specific verb 'updates' and the resource 'project memory/state file.' It further distinguishes itself by prescribing end-of-session use, separating it from sibling tools like store_decision or working_memory_set.

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 explicit timing guidance ('Call this at the END of every session'), which is strong contextual instruction. However, it does not explicitly name alternatives or state when not to use it, leaving some ambiguity relative to sibling tools like store_decision.

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