Skip to main content
Glama

会话详情

get_session_detail

Retrieve messages from a stored session with optional role filtering, message-range limits, and per-message character truncation; default caps keep responses small unless explicit ranges are provided.

Instructions

取某会话的消息(可按角色过滤、限制范围与长度)。默认安全:最多 20 条 × 1000 字 ≈ 20KB。要更多请显式传 start_msg/end_msg 或 max_chars。session_id 支持前缀

Input Schema

NameRequiredDescriptionDefault
roleNo只取该角色的消息(user=用户提问,轻量)
end_msgNo结束消息序号(含)
projectNo项目根绝对路径。仅当服务端提示 unresolved_project(多项目/未自动识别)时选择传此参;传一次后本连接记住
max_charsNo单条截断长度(默认 1000;需全文时显式传大值如 5000)
start_msgNo起始消息序号(含)
session_idYes
include_exchangesNo附带关键往返(用户提问+AI结论对,约 3KB)——理解"为什么"的中间粒度,省去拉全文

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.1/5.0
Behavior4/5

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

没有注解,所以描述承担了披露行为特征的全部责任,并且确实披露了关键操作形态:约 20KB 的默认截断上限、单条截断长度,以及 session_id 支持前缀匹配。缺失的是返回内容形态和权限要求,但对读取工具来说,关键约束已经交代清楚。

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?

三段式短句,先说作用,再说默认安全上限,最后说如何扩量,没有废话,并且安全默认值前置。

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?

7 个参数、无输出 schema、无注解;描述覆盖了主要行为约束与扩量路径。仍缺少返回结构说明,对首次调用者存在少量不确定,但整体足够调用。

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 描述覆盖率已达 86%,分数线是 3;描述还补充了 max_chars 的默认值、用 start_msg/end_msg 扩量这一条件,以及 session_id 支持前缀匹配,这些在 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?

具体动作加资源:取某会话的消息,并附带过滤范围(按角色过滤、限制范围与长度)。相比 get_linked_sessions、search_sessions 这类兄弟工具,它没有明确区分,但核心目的没有歧义。

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?

清楚说明默认安全行为最多 20 条 × 1000 字 ≈ 20KB,并指出需要更多数据时显式传 start_msg/end_msg 或 max_chars 来扩大范围。这给出了明确的分页和扩量上下文,但从未说明什么时候改用 search_sessions 或 list_sessions。

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