im_list_messages
Retrieve historical messages from a chat or thread using chat ID. Supports time range, sorting, and pagination for efficient access.
Instructions
获取会话(单聊/群聊)的历史消息
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"container_id": "<container_id>"
},
"name": "im_list_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_time | No | 结束时间(秒级时间戳) | |
| page_size | No | 分页大小 | |
| sort_type | No | 排序方式 | |
| page_token | No | 分页标记 | |
| start_time | No | 开始时间(秒级时间戳) | |
| container_id | Yes | 会话 ID(chat_id 或 thread_id) | |
| container_id_type | No | 会话类型 | chat |