Skip to main content
Glama

claude_list_sessions

List locally hosted Claude Code CLI session records, filter by working directory or session ID, and optionally include each session's full last reply.

Instructions

查询本地已托管的 Claude Code CLI 会话记录列表,可选按 cwd 或 session_id 过滤,并支持拉取完整末次回复。

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

Input Schema

NameRequiredDescriptionDefault
cwdNo可选工作目录过滤路径。
session_idNo可选精确查询指定 session_id 的托管详情及末次完整回复。
include_last_resultNo可选是否在列表中附带每个会话最后一次执行的完整回复文本(默认 false)。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It signals a read-only listing of local sessions and discloses that the result set can include full last-reply text, but it omits ordering, pagination, size limits, and what the returned list actually contains.

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?

It is a single front-loaded sentence with the core purpose first and filters after; it is dense but every clause is relevant, though the stacked parenthetical qualifiers make it slightly harder to scan.

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?

With three optional parameters, no annotations, and no output schema, an agent knows how to call it but not what the returned records look like or in what order. Adequate but leaves notable gaps for a listing tool.

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 description coverage is 100%, so all three parameters are already documented in the schema. The description echoes the cwd and session_id filters and the full-last-reply capability without adding semantics beyond what the schema provides, which matches the baseline for high coverage.

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?

The description gives a specific verb (查询/列表) plus a resource (本地已托管的 Claude Code CLI 会话记录) and states the scoping constraint that the sessions are locally hosted. An agent can distinguish it from mutation-oriented siblings such as claude_resume or claude_run, though it never names an alternative 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?

Usage is only implied: the description says the list can be filtered by cwd or session_id and that the full last reply can be fetched, which hints at when to use it, but there is no explicit when-to-use vs when-not guidance and no pointer to claude_resume for resuming a session.

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