Skip to main content
Glama

update_session_state

Update an existing session's state by merging progress, phase, and metadata. Enforces orchestrator-only authorization and versioned concurrency to prevent update conflicts.

Instructions

Update the session state. Orchestrator only. The only way to modify session state.

AUTOMATIC TRIGGERS - Call this when:

  • You need to record progress updates

  • Setting the current phase of work

  • Storing session metadata (current step, active agents, etc.)

ONLY the orchestrator can call this. State is versioned with optimistic concurrency to prevent conflicts. If update fails, retry with latest state.

PARAMETERS:

  • session_id: Target session

  • state: New state dict (will be merged with existing state)

  • orchestrator_id: The orchestrator's agent ID (for authorization)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateYes
session_idYes
orchestrator_idYes
Behavior4/5

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

With no annotations, the description carries the disclosure burden and does a solid job: it states the state is merged, versioned, and uses optimistic concurrency, and gives retry guidance on failure. It also reveals the authorization requirement. It could add response/error details, but the core behavior is transparent.

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

Conciseness3/5

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

The description is organized with clear sections (purpose, triggers, constraints, parameters), but it repeats 'orchestrator only' twice, which is redundant. The trigger list is useful, but a tighter edit would remove the duplicated constraint.

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?

Covers purpose, triggers, authorization, merge semantics, concurrency, and retry behavior, which is substantial for a 3-parameter tool with no annotations or output schema. It doesn't describe the return value or exact merge depth, so it's not fully complete, but it's enough for correct invocation.

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

Parameters5/5

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

Input schema has no descriptions (0% coverage) and only raw types, so the description is the sole source of parameter meaning. It explains session_id as target, state as a dict merged with existing state, and orchestrator_id as the authorization agent ID, adding genuine semantic value for all three parameters.

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?

States 'Update the session state' with a specific verb and resource, and explicitly calls it 'The only way to modify session state,' distinguishing it from read-only siblings like get_session_state. The orchestrator-only constraint further clarifies its unique role.

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?

Provides an explicit 'AUTOMATIC TRIGGERS' list with concrete use cases (recording progress, setting phase, storing metadata) and states a hard exclusion: only the orchestrator may call it. It doesn't name an alternative tool, but 'the only way to modify session state' gives clear selection context among siblings.

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/Vedant9500/OpenLMlib'

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