Skip to main content
Glama

session_init

Initialize an AI session by setting the project root and loading the memory index. Call this first to establish project context and check the vector-index status.

Instructions

Single-call session bootstrap. Call this FIRST in every AI session.

Performs:
  1. Sets project root (if `project_path` is provided).
  2. Warns if the chosen root is the MCP server's own directory.
  3. Reads `.ai/memory.md` (only the index/headings — full text on demand).
  4. Refreshes the lightweight L0 manifest.
  5. Reports vector-index status (without loading it).
  6. Starts the self-healing maintenance daemon.

The heavy vector store / embedding model is NEVER loaded here — it is
lazily loaded only when a semantic query needs it. This keeps
`session_init` well under the MCP 30s tool timeout even on multi-GB
repositories.

Args:
    project_path: Absolute path to the target project. Leave empty to use
                  auto-detection (CWD + project markers).

Returns:
    Consolidated Markdown brief summarising project root, memory, and index state.

Input Schema

NameRequiredDescriptionDefault
project_pathNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely succeeds: it discloses the deliberate lazy-loading of the vector store, the 30s timeout rationale, the warning behavior for a server-owned root, and that only memory headings are read. It does not say whether setting project_path persists state across calls, which is the main missing side-effect disclosure.

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-loaded with the action and a numbered operation list, then args and returns. The timeout/lazy-load paragraph is slightly verbose but earns its place by justifying a performance trait an agent might otherwise worry about.

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?

An output schema exists, so the returns line only needs to name the shape, which it does. Combined with the step list and timeout rationale, the definition is complete enough to call correctly; only persistent-state semantics for project_path remain unexplained.

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 0% and the single parameter has only a bare title, but the description compensates with 'Absolute path to the target project' and the empty-string auto-detection semantics (CWD + project markers). That adds genuinely schema-external meaning.

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?

States a clear purpose ('single-call session bootstrap') and enumerates the six concrete operations performed, so an agent knows exactly what will happen. It does not explicitly contrast itself with siblings like set_project_root, read_memory_index, or get_context_brief, which it partially subsumes.

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?

'Call this FIRST in every AI session' gives a strong, explicit ordering instruction. It lacks explicit when-not conditions or named alternatives, but the intended usage window is unambiguous.

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