Skip to main content
Glama

recent_messages

Retrieve recent sent and received bot messages to review conversation context. Filter by platform or session and set a result limit.

Instructions

查询机器人最近收发的消息(会话记录,非实时订阅)。

实时观测新消息请用 subscribe_events + poll_events;本工具适合回看上下文。

Args: platform: 可选,按平台过滤(如 onebot11) session: 可选,会话键 "平台:类型:ID"(如 "onebot11:group:123456",类型 private/group/user/channel/guild/thread)精确查询该会话;与 platform 同给时须前缀匹配 limit: 最多返回条数(默认 50,上限 500)

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "recent_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
sessionNo
platformNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose meaningful behavior: this is a historical query rather than a subscription, and limit is capped at 500 with a default of 50. It does not state result ordering (e.g., newest-first) or any permission/scope constraints, which would matter for a message-history tool.

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?

Front-loaded with purpose and the alternative, then a compact Args block. Every line adds information that the schema lacks, so nothing is filler despite the multi-section layout.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter read tool with an output schema already describing return values, the description covers purpose, alternatives, all parameter semantics, and the result cap. Nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must do all the work and it does: platform is given with a concrete example (onebot11), session is given a full key format with the allowed type values (private/group/user/channel/guild/thread) plus the prefix-matching rule when combined with platform, and limit gets both default and maximum.

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?

States a specific verb and resource (查询机器人最近收发的消息) and immediately scopes it as 会话记录,非实时订阅. It also explicitly separates itself from subscribe_events + poll_events, so an agent can pick the right tool without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives both directions: use subscribe_events + poll_events for live observation, use this tool for 回看上下文 (looking back at context). The alternative and the selecting condition are named outright, leaving nothing to infer.

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