Skip to main content
Glama

读取会话内容

piweb_get_session

Read a pi coding agent session transcript by ID, prefix, name, or message snippet, with paging, tool-call summaries, and optional thinking previews.

Instructions

读取一个会话的对话内容(默认最后 30 条消息,含工具调用摘要)。session 可传完整 id、id 前缀、会话名称或名称/首条消息片段。要读更早的历史用 offset 往前翻;思考内容默认只给预览,include_thinking="full" 会去取完整思考链。默认会把该会话在本地标记为已读。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tailNo读取最后 N 条消息,默认 30;要全量就传大值
formatNomarkdown(默认)或 json(原始消息结构)
offsetNo从末尾往前跳过 N 条,用于分页读更早的历史,默认 0
sessionYes会话 id / id 前缀 / 名称 / 名称或首条消息片段
mark_readNo读完后标记已读,默认 true
max_charsNo正文总字数预算,默认 60000
include_toolsNo是否包含工具调用与结果,默认 true
include_thinkingNo思考内容:none(默认)/preview(预览)/full(取全文,较慢)
tool_result_charsNo单条工具结果截断长度,默认 800

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations are sparse (readOnlyHint=false, openWorldHint=true), but the description discloses meaningful side effects and defaults: it marks the session as read locally, defaults to the last 30 messages, includes tool summaries, and shows thinking only as a preview unless include_thinking='full' is used, which is noted as slower. It does not cover auth or rate limits, but adds substantial context beyond annotations.

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?

The description is a single dense paragraph that front-loads what the tool does, then covers session identifiers, pagination, thinking behavior, and read marking. Every sentence carries information, though it could be slightly more scannable.

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?

For a 9-parameter tool with no output schema and minimal annotations, the description covers the most important behavioral defaults and side effects. Remaining schema-level details like format, max_chars, and tool_result_chars are documented in the schema, so the definition is reasonably complete.

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 the schema already documents all 9 parameters. The description largely repeats schema facts (session id/prefix/name/snippet, default 30 messages, default read marking) and adds only slight nuance about include_thinking='full' fetching the complete chain.

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 specific verb and resource: reading a session's conversation content, with defaults for the last 30 messages and tool-call summaries. It is clearly distinguishable from listing/searching/watching siblings by what it returns, but it does not explicitly name an alternative tool.

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?

Gives operational guidance for pagination ('要读更早的历史用 offset 往前翻') and for fetching full thinking chains, which implies how to use the tool. However, it never states when to use this tool versus siblings like search_sessions, list_unread, or watch_session, nor any exclusions.

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