Skip to main content
Glama

get_platform_session_messages

Retrieve recent chat messages from AstrBot logs for debugging and monitoring, using log history as the reliable source when conversation data is unavailable.

Instructions

Get a platform target's recent messages from AstrBot logs.

This tool intentionally uses AstrBot's log broker history (/api/log-history) as the source of truth, since some AstrBot builds do not persist platform conversation history under /api/conversation/detail for group/user targets.

Args:

  • target_id: Platform target ID (e.g. group_id like "1030223077").

  • platform_id: Optional platform id (e.g. "napcat"). If omitted, use the first enabled platform.

  • message_type: "GroupMessage" or "FriendMessage" (default: "GroupMessage").

  • wait_seconds: If > 0, poll and return SSE-like events for up to this many seconds.

  • max_messages: Max number of history items to return (from the tail).

  • poll_interval_seconds: Poll interval when wait_seconds > 0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
target_idYes
platform_idNo
message_typeNoGroupMessage
wait_secondsNo
max_messagesNo
poll_interval_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explaining the data source rationale, polling behavior when wait_seconds > 0, and that it returns 'history items from the tail.' It doesn't mention rate limits, authentication needs, or error conditions, but provides substantial behavioral context beyond basic functionality.

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 efficiently structured with a clear purpose statement, usage rationale, and well-organized parameter documentation. Every sentence earns its place, with no redundant information. The parameter explanations are front-loaded with the most critical information first.

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?

Given the tool's complexity (6 parameters, polling behavior, multiple data sources) and the presence of an output schema (which handles return values), the description provides excellent context. It covers the why (source rationale), when (build-specific usage), how (polling behavior), and what (parameter semantics) without needing to duplicate output schema information.

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?

With 0% schema description coverage for 6 parameters, the description fully compensates by providing clear semantic explanations for all parameters: target_id examples, platform_id default behavior, message_type options and default, wait_seconds polling behavior, max_messages scope, and poll_interval_seconds usage context. This adds significant value beyond the bare schema.

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 specific action ('Get'), resource ('platform target's recent messages'), and source ('from AstrBot logs'). It explicitly distinguishes this tool from alternatives by explaining it uses '/api/log-history' instead of '/api/conversation/detail' for certain builds, making it distinct from any potential sibling tools that might use different endpoints.

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?

The description provides explicit guidance on when to use this tool versus alternatives: 'This tool intentionally uses AstrBot's log broker history... since some AstrBot builds do not persist platform conversation history under /api/conversation/detail.' This clearly indicates this is the preferred tool for certain build configurations and implicitly suggests alternatives might exist for other scenarios.

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/xunxiing/astrbotmcp'

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