Skip to main content
Glama

brain_session_end

Ends a coding session by recording a summary, auto-extracting facts, and storing them as persistent memories.

Instructions

End a session. Records summary, auto-extracts facts from summary (v1.1 Auto-Learning), and stores them as memories.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "session_id": "<session_id>"
    },
    "name": "brain_session_end"
  }
}

Input Schema

NameRequiredDescriptionDefault
projectNoProject context for auto-learned facts. Falls back to session project.
summaryNoWhat was accomplished. Auto-learning extracts facts from this.
session_idYesSession ID from brain_session_start or brain_session_start_smart.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose the key non-obvious behavior: facts are auto-extracted from the summary and persisted as memories, which is a write side effect an agent must know about. It does not say whether the session becomes invalid afterwards, whether the operation is idempotent, or what happens if session_id is unknown or already ended.

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?

A single front-loaded sentence with the primary action first and consequences after; no filler. The parenthetical version tag is slightly noisy but negligible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description covers what happens internally but omits return information and failure modes (invalid or already-ended session). An agent could call it, but not confidently predict the response or error behavior.

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% and the schema already explains session_id provenance and the project fallback, so the baseline is 3. The description only reinforces that summary drives auto-learning, adding no syntax, length limits, or formatting guidance beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"End a session" gives a specific verb and resource, and the sentence continues with the concrete consequences (records summary, extracts facts, stores memories). It is clearly distinguishable from brain_session_start, though it never names the start/start_smart siblings explicitly.

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

Usage Guidelines3/5

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

The name and description imply this is the closing counterpart to brain_session_start, but there is no explicit statement of when to call it (e.g., at the end of a work block) or when not to (e.g., session already ended). Usage must be inferred from the lifecycle naming convention.

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