Skip to main content
Glama

read_p2p_messages

Read P2P direct message chat history using user access token, even for chats the bot cannot access. Auto-expands merge-forward messages and returns newest first.

Instructions

[User UAT] Read P2P (direct message) chat history using user_access_token. Works for chats the bot cannot access. Returns newest messages first by default. Auto-expands merge_forward messages into their child messages by default — disable with expand_merge_forward=false. Requires OAuth setup.

Sender semantics (v1.3.12): each message has a displayLabel (e.g. 周宇, [Bot] Claude聊天助手, [匿名], [系统], [已撤回] 怪兽) — prefer it over raw senderId when narrating who-said-what. Also surfaced: senderType (user|app|anonymous), senderIdType (open_id|union_id|user_id), senderTenantKey, isExternal (cross-tenant), isRecalled, isThreadReply (parent_id present).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYesChat ID (numeric from create_p2p_chat, or oc_xxx from list_user_chats). Both formats work.
end_timeNoEnd timestamp in seconds (optional)
page_sizeNoMessages to fetch (default 20, max 50)
sort_typeNoSort order (default: ByCreateTimeDesc = newest first)
page_tokenNoPagination cursor — pass the pageToken from a previous response to fetch the next (older) page when hasMore is true.
start_timeNoStart timestamp in seconds (optional)
expand_merge_forwardNoAuto-expand merge_forward placeholders into their child messages (default true). Children carry parentMessageId; use that id (not the child id) with download_message_resource (kind=image or file).
Behavior5/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, and it does so thoroughly. It discloses defaults ('newest messages first', 'auto-expands merge_forward'), toggle behavior ('disable with expand_merge_forward=false'), auth requirements ('Requires OAuth setup'), and gives detailed sender semantics including displayLabel, senderType, isRecalled, and thread info. This goes far beyond what the schema provides and gives the agent critical context for interpretation.

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 well-structured and front-loaded: the first sentence states the core purpose and access method, followed by key defaults and requirements. The sender semantics section is clearly formatted with bold headers and concrete examples, adding necessary detail without fluff. Every sentence contributes meaningful information, and the length is justified by the complexity.

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 lack of an output schema, the description compensates well by explaining key response fields (displayLabel, senderType, isRecalled) and pagination is implied via page_token schema. It also covers important behavior like merge_forward expansion and cross-tenant indicators. However, it does not fully describe the overall response envelope (e.g., array structure, pagination fields like hasMore), though the schema hints at it. Overall, it is nearly complete for practical use.

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%, with every parameter already explained in the input schema. The description does not add parameter-level meaning beyond what the schema states; it only reinforces the expand_merge_forward behavior already documented. Since the schema handles parameter semantics fully, a baseline of 3 is appropriate.

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: 'Read P2P (direct message) chat history using user_access_token.' It also distinguishes from general message readers by noting it 'Works for chats the bot cannot access,' which sets it apart from siblings like read_messages. The verb 'read' plus specific resource 'P2P chat history' and access method makes the purpose immediately clear.

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 on when to use the tool: 'Works for chats the bot cannot access' implies using it when the bot's own token lacks access, and 'Requires OAuth setup' warns about the authentication prerequisite. However, it does not explicitly name alternative tools (e.g., read_messages for group chats) or state when not to use it, so it stops short of fully explicit exclusion guidance.

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/EthanQC/feishu-user-plugin'

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