Skip to main content
Glama

status

Monitor the health and progress of indexing operations to track session counts, database size, and ensure proper functioning of the semantic search system.

Instructions

Check the health and progress of lore indexing. Shows indexing status, session counts, DB size. Use this to monitor indexing progress after calling index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handleStatus function implements the core logic for the "status" tool, retrieving indexing progress and database statistics.
    export async function handleStatus(
      db: Database.Database
    ): Promise<{ content: Array<{ type: string; text: string }> }> {
      const progress = getIndexProgress();
    
      const totalSessions = (db.prepare("SELECT COUNT(*) as c FROM sessions").get() as any).c;
      const indexedSessions = (db.prepare("SELECT COUNT(*) as c FROM sessions WHERE indexed_at IS NOT NULL").get() as any).c;
      const totalChunks = (db.prepare("SELECT COUNT(*) as c FROM chunks").get() as any).c;
    
      let dbSizeMb = 0;
      try {
        dbSizeMb = Math.round(statSync(CONFIG.dbPath).size / 1024 / 1024 * 10) / 10;
      } catch { /* db might not exist yet */ }
    
      const result: any = {
        indexing: progress.running
          ? (() => {
              const elapsed = Date.now() - progress.startedAt;
              // ETA based on chunks processed (more accurate than session count)
              const totalChunksProcessed = progress.chunksCreated + progress.currentSessionChunks;
              const chunksPerMs = totalChunksProcessed > 0 ? totalChunksProcessed / elapsed : 0;
              // Estimate remaining: current session remaining + unprocessed sessions (estimate avg chunks/session)
              const currentRemaining = progress.currentSessionTotal - progress.currentSessionChunks;
              const processedSessions = progress.sessionsIndexed + progress.sessionsSkipped;
              const remainingSessions = progress.sessionsTotal - processedSessions - 1; // -1 for current
              const avgChunksPerSession = processedSessions > 0 ? progress.chunksCreated / Math.max(progress.sessionsIndexed, 1) : 0;
              const estimatedRemainingChunks = currentRemaining + (remainingSessions * avgChunksPerSession);
              const etaMs = chunksPerMs > 0 ? Math.round(estimatedRemainingChunks / chunksPerMs) : null;
              const etaStr = etaMs !== null
                ? etaMs < 60000 ? `${Math.round(etaMs / 1000)}s` : `${Math.round(etaMs / 60000)}m`
                : "calculating...";
              return {
                status: "running",
                progress: `${progress.sessionsIndexed}/${progress.sessionsTotal} sessions`,
                current_project: progress.currentProject,
                current_session: progress.currentSessionTotal > 0
                  ? `embedding ${progress.currentSessionChunks}/${progress.currentSessionTotal} chunks`
                  : undefined,
                chunks_created: progress.chunksCreated,
                elapsed_ms: elapsed,
                eta: etaStr,
              };
            })()
          : progress.completedAt
            ? {
                status: "idle",
                last_run: `${progress.sessionsIndexed} sessions indexed, ${progress.sessionsSkipped} skipped, ${progress.chunksCreated} chunks in ${progress.completedAt - progress.startedAt}ms`,
                error: progress.error,
                ...(progress.sessionsSkipped > 0 ? { skip_reasons: progress.skipReasons } : {}),
              }
            : { status: "never_run" },
        db: {
          total_sessions: totalSessions,
          indexed_sessions: indexedSessions,
          empty_sessions: (db.prepare("SELECT COUNT(*) as c FROM sessions s WHERE NOT EXISTS (SELECT 1 FROM chunks c WHERE c.session_id = s.id)").get() as any).c,
          total_chunks: totalChunks,
          size_mb: dbSizeMb,
        },
      };
    
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
  • src/server.ts:118-126 (registration)
    The "status" tool is registered here with the MCP server using the handleStatus function as its handler.
    // status tool
    server.tool(
      "status",
      "Check the health and progress of lore indexing. Shows indexing status, session counts, DB size. Use this to monitor indexing progress after calling index.",
      {},
      async (): Promise<ToolResult> => {
        return handleStatus(db);
      }
    );
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes what the tool does (checking health/progress and showing specific metrics) but lacks details on permissions needed, rate limits, or what happens if indexing isn't running. It doesn't contradict annotations, but could be more informative.

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

Conciseness5/5

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

The description is appropriately sized with two sentences that are front-loaded: the first states the purpose and what it shows, the second provides usage guidance. Every sentence adds value without redundancy or waste.

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?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is reasonably complete. It explains the tool's purpose, what it returns, and when to use it. However, without an output schema, it could benefit from more detail on return format or error conditions, but this is minor for a status-check tool.

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?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the lack of inputs. The description doesn't need to add parameter information, but it implicitly confirms no parameters are needed by not mentioning any. This meets the baseline for zero-parameter tools.

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 tool's purpose with specific verbs ('check', 'shows') and resources ('health and progress of lore indexing', 'indexing status, session counts, DB size'). It distinguishes from siblings by focusing on monitoring rather than performing operations like 'index' or 'search'.

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?

The description provides clear context for usage ('Use this to monitor indexing progress after calling index'), indicating when to use it in relation to the 'index' sibling tool. However, it doesn't explicitly state when not to use it or mention alternatives among other siblings like 'list_sessions' or 'get_context'.

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/hyunjae-labs/lore'

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