Skip to main content
Glama

Reset Session Branch

reset_session_branch

Reset or switch the active session branch to control where writes go: omit the branch to start a fresh change set on the next write, or name a branch to target it.

Instructions

Reset or switch the active session branch for the calling client.

Use this to recover or take control of which branch your writes target:

  • No branch — clears the cached session branch; the next write auto-creates a fresh one. Useful after you have merged your work and want to start a new change set.

  • With branch — makes the named branch the session branch. If it does not exist and the name matches the configured branch pattern, it is created and reported. The instance default branch and merged/read-only branches are rejected.

Note: a merged or deleted session branch is recovered automatically on the next write — this tool is the explicit override on top of that.

Scope: the session branch is kept per authenticated caller, and per MCP session when the client has one. Without credentials or an MCP session, all clients of the server share one session branch. A reset or switch applies to every conversation that shares the session branch.

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

Input Schema

NameRequiredDescriptionDefault
branchNoTarget branch. Omit to drop the cached session branch so the next write creates a fresh one. Provide a name to make that branch the session branch (created if it does not exist and the name matches the configured pattern).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.3.0
    • changedInput schema / properties / branch / description
      Previous value: -"Target branch. Omit to drop the cached session branch so the next write creates a fresh one. Provide a name to switch this session to that branch (created if it does not exist and the name matches the configured pattern)."New value: +"Target branch. Omit to drop the cached session branch so the next write creates a fresh one. Provide a name to make that branch the session branch (created if it does not exist and the name matches the configured pattern)."
  2. Changed1 schema field changedv1.2.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  3. Addedv1.1.6

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that a missing branch is auto-created on the next write, that non-matching or default/merged/read-only branches are rejected, and that merged or deleted session branches recover automatically. It also explains the scope model: per authenticated caller, per MCP session, or shared across clients when neither exists, and that changes apply to every conversation sharing the branch.

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?

Front-loads the core action, then separates the two modes into bullets and closes with a scope note that is lengthy but relevant to correctness. The scope paragraph is dense, yet each sentence carries operational meaning.

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?

For a one-parameter control tool with annotations and no output schema, the definition covers creation, rejection, automatic recovery, and per-caller/per-session scoping. An agent has enough to invoke it correctly without guessing about side effects or shared-state impact.

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?

Schema coverage is 100%, so the baseline is high, but the description still adds meaning: omitting branch drops the cached branch and triggers fresh creation, while providing a name switches to it and may create it if the configured pattern matches. Those creation and rejection semantics are clearer here than in the schema alone.

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 a specific verb and resource ('Reset or switch the active session branch for the calling client') and makes clear this is a control operation, distinct from read-oriented siblings like get_session_info.

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?

Gives explicit when-to-use context for both modes: omitting branch to clear the cached branch after merging, and supplying a branch to take control of write targeting. It also notes this is an explicit override over the automatic recovery behavior, though it does not directly name which sibling to use instead for inspecting branch state.

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