Skip to main content
Glama

get_state

Retrieves current project memory—decisions, preferences, things to avoid, and next steps—scoped to the current git branch so sessions restore context at startup.

Instructions

Returns the current project memory: decisions made, preferences established, things to avoid, and what to pick up next. State is scoped to the current git branch when the project is a git repository, falling back to the default branch state and then to the legacy flat state file. A detached HEAD (a bare commit checkout, e.g. CI) is scoped to that exact commit instead, and never inherits the flat or default-branch state. When user-wide global memory exists (written via update_state with scope 'global'), a deduplicated 'Global Memory' section is appended after the project state; project and branch entries always take precedence. Call this at the START of every session to restore context.

Input Schema

NameRequiredDescriptionDefault
project_pathNoAbsolute path to the project root. Defaults to current working directory.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.20
  2. Removedv1.1.16
  3. Addedv1.1.15
  4. Removed
  5. Addedv1.1.13
  6. Removedv1.1.12
  7. First observedv1.0.2

TDQS

A4.8/5.0
Behavior5/5

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

Since no annotations are present, the description carries the entire burden of disclosure. It provides exceptional behavioral detail, explaining complex scoping rules (git branch vs. detached HEAD) and precedence (project > global memory) which are crucial behavioral traits.

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 description is necessarily long due to the complex state management logic (git vs. flat vs. global). However, it is logically structured, starting with what it returns and ending with the mandatory usage guidance.

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?

It is extremely complete, covering the data structure (memory content), the retrieval mechanics (scoping rules like detached HEAD vs. flat state), and the required operational context (start of session). No critical information 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?

While the schema is straightforward, the description provides essential semantic context for 'project_path' by defining that the parameter determines the project root, which is the basis of the entire memory lookup scope described.

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 primary purpose: 'Returns the current project memory.' It distinguishes itself by detailing the specific contents (decisions, preferences, things to avoid) and the specific operational scope of the memory retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit usage instructions: 'Call this at the START of every session to restore context.' This dictates exactly when the agent should prioritize this tool over others.

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