Skip to main content
Glama

read_p2p_messages

Fetch direct message chat history using a user access token, including chats inaccessible to the bot. Supports pagination, sorting, and auto-expansion of merged messages.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chat_idYesChat ID (numeric from create_p2p_chat, or oc_xxx from list_user_chats). Both formats work.
page_sizeNoMessages to fetch (default 20, max 50)
start_timeNoStart timestamp in seconds (optional)
end_timeNoEnd timestamp in seconds (optional)
sort_typeNoSort order (default: ByCreateTimeDesc = newest first)
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).
Behavior3/5

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

Without annotations, the description reveals key behaviors: returns newest first by default, auto-expands merge_forward messages, and notes how to use child message IDs. However, it omits details on rate limits, pagination, or error states, leaving gaps in full behavioral understanding.

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 compact, covering purpose, usage context, ordering, default behavior, and requirements in a few sentences. It avoids redundancy but could be slightly more structured for easier scanning.

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?

The description explains core functionality and parameter nuances, but lacks details on response format, pagination handling, or how to retrieve all messages beyond a single page. Given no output schema, more completeness would benefit the agent.

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?

Though schema coverage is 100%, the description adds value beyond field names and types. It explains that chat_id can be numeric or oc_xxx from different sources, and clarifies the expand_merge_forward parameter's purpose and follow-up usage with download_message_resource.

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 'Read P2P (direct message) chat history using user_access_token', specifying the action, resource, and auth method. It distinguishes itself from bot-accessible chats, implying a different use case from sibling tools like read_messages.

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 explicitly notes that the tool works for chats the bot cannot access and requires OAuth setup. It provides clear context for when to use this tool, but does not explicitly state when to avoid it or mention alternatives.

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