Skip to main content
Glama

知你AI助手|多平台客户与客服数据 MCP

获取消息

zhini_fetch_messages

读取聊天消息。支持按 sid 首次加载会话消息、按 mid 游标翻页、按 uid 查询某客户消息。适用于查看当前会话上下文、查看历史会话命中词前后文、按 UID 拉取某段时间内消息并总结诉求/投诉/售后问题。已知 uid/sid/mid 时直接调用本工具,不要先搜索。约束:sid、mid、uid 至少传一个;传 mid 时建议同时传 direction;按 uid 查询时 start_time/end_time 可选;size 最大 20。时间语义:start_time/end_time 是消息发生时间过滤,不是会话开启时间。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
midNo消息 ID。按游标翻页时传;传 mid 时建议同时传 direction。
sidNo会话 ID。首次按会话加载消息时传。
uidNo知你侧客户 UID。按客户查询消息时传,可结合 start_time/end_time 限定消息发生时间。
sizeNo返回消息数量,默认 20,最大 20。
end_timeNo查询消息结束时间,秒级 Unix 时间戳。按 uid 查询时可选,表示消息发生时间。
directionNo翻页方向。backward 表示更早消息,forward 表示更新消息。
start_timeNo查询消息开始时间,秒级 Unix 时间戳。按 uid 查询时可选,表示消息发生时间。
include_midNo为 1 时包含指定 mid;翻页查看某条消息前后文时使用。

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

No annotations exist, so the description carries full responsibility. It discloses key behavioral constraints (required id at least one, size cap, time filter meaning) but does not mention potential side effects (none expected for a read), response format, or error behavior. Given it's a read-only operation, this is adequate but not exhaustive.

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 dense but well-organized: purpose, use cases, then constraints. It front-loads the core function and immediately gives practical context. Minor redundancy in listing use cases, but every sentence adds value.

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 tool's complexity (3 modes, 8 params) and no output schema, the description covers all major usage paths and constraints. It lacks an explicit statement about return format, but given the read nature and sibling tools' patterns, this is a minor gap. Overall it provides sufficient context for correct invocation.

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?

Schema already covers all parameters (100% coverage), but description adds critical relational meaning: sid for first load, mid for cursor pagination, uid for customer scope, and the semantic clarification that start_time/end_time filter message time, not session start. This goes beyond the 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?

Description clearly states the tool reads chat messages and enumerates three distinct access modes (by sid, mid, uid) with concrete use cases like viewing session context or summarizing complaints. It also differentiates from sibling search tools by saying 'call directly, don't search first'.

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?

Provides explicit usage guidance: when to use each parameter mode (sid for first load, mid for pagination, uid for customer queries), when to use directly vs searching (known ids), and constraints like 'at least one of sid/mid/uid' and 'mid with direction'. Also clarifies time semantics to avoid misuse.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.