Skip to main content
Glama

m9k_sessions

Read-onlyIdempotent

List and filter indexed sessions by project, source type, or limit results for persistent memory management in Claude Code.

Instructions

List all indexed sessions, optionally filtered by project.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoFilter by project path
limitNoMax sessions
sourceNoFilter by source type. Default: all sources.

Implementation Reference

  • The 'm9k_sessions' tool handler implementation, which queries the 'conv_sessions' table.
    server.registerTool(
      'm9k_sessions',
      {
        description: 'List all indexed sessions, optionally filtered by project.',
        inputSchema: {
          project: z.string().optional().describe('Filter by project path'),
          limit: z.number().int().min(1).max(100).default(20).describe('Max sessions'),
          source: z
            .enum(['conversations', 'git', 'files'])
            .optional()
            .describe('Filter by source type. Default: all sources.'),
        },
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ project, limit }) => {
        let sql = 'SELECT * FROM conv_sessions WHERE deleted_at IS NULL';
        const params: unknown[] = [];
        if (project) {
          sql += ' AND project = ?';
          params.push(project);
        }
        sql += ' ORDER BY started_at DESC LIMIT ?';
        params.push(limit);
        const rows = ctx.db.prepare(sql).all(...params);
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(rows) }],
        };
      },
    );
Behavior3/5

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

Annotations already declare read-only, idempotent, non-destructive nature. The description adds 'indexed' qualifier, implying cached/pre-computed data versus live queries, which is useful behavioral context. However, it omits discussion of pagination behavior (limit parameter) or result ordering.

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?

Single sentence, 9 words, efficiently front-loaded with action verb. No redundant phrases. However, extreme brevity comes at cost of omitting significant functional details (source filtering, pagination) that would improve agent selection accuracy.

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?

Adequate for a read-only list operation with safety annotations covering risk profile. However, given the schema richness (3 filter dimensions including source type enum), the description underspecifies the tool's filtering capabilities. No output schema exists, though this is less critical for a list operation.

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%, establishing baseline 3. The description mentions 'project' filtering but ignores the 'source' enum (conversations/git/files) and 'limit' parameters, missing opportunity to explain the multi-dimensional filtering capability. No parameter format guidance added beyond 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?

Clear verb 'List' and resource 'indexed sessions'. Scope 'all' with optional project filter is stated. However, fails to explicitly differentiate from sibling 'm9k_search' (which also retrieves sessions), leaving ambiguity about when to browse vs search.

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

Usage Guidelines2/5

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

Mentions optional project filtering but provides no guidance on when to use this tool versus 'm9k_search' or other session-access tools. Does not mention the 'source' parameter's utility for filtering by conversations/git/files, which is critical usage 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/louis49/melchizedek'

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