Skip to main content
Glama
wechat-localmind

wechat-localmind

by qilaidev

wechat_fetch_messages

Read-onlyIdempotent

Fetch cleaned WeChat direct, group, and official-account messages by cursor or time window, with resolved names, mentions, reply context, revoked-message filtering, and context buffers.

Instructions

Fetch cleaned WeChat messages across 1-on-1 direct chats, group chats, or official accounts by incremental cursor (after_msg_id) or time window (since). Automatically resolves 4-tier real names (remark > group nick > nick > wxid), @mentions, 150-char reply chains, filters out revoked messages, and prepends context buffer messages.

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": {
      "chat_ids": "<chat_ids>"
    },
    "name": "wechat_fetch_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
freshNoForce immediate SQLCipher decryption and SQLite snapshot refresh.
sinceNoRelative duration (e.g. '12h', '24h', '7d') or ISO-8601 timestamp when after_msg_id is not set.24h
untilNoOptional upper bound ISO-8601 timestamp.
formatNomarkdown
chat_idsYesArray of WeChat chat_ids (wxid_*, alias, @chatroom, gh_*, filehelper) or ['ALL_ALLOWED'] / ['ALL_DIRECT'] / ['ALL_GROUPS'] / ['ALL_OFFICIAL'].
chat_typeNoOptional session type filter ('all', 'direct', 'group', 'official').all
fold_noiseNoFold consecutive short acknowledgment messages ('收到', 'OK', '+1') in markdown mode.
after_msg_idNoGlobal monotonic message cursor. Fetches only messages with msg_id > after_msg_id.
context_bufferNoNumber of preceding history messages to include as context buffer (default 10).
limit_per_chatNoMax messages per chat session (default 500, max 3000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.0.0
    • changedInput schema / properties / chat_ids / description
      Previous value: -"Array of group chat_ids (@chatroom) or ['ALL_ALLOWED']."New value: +"Array of WeChat chat_ids (wxid_*, alias, @chatroom, gh_*, filehelper) or ['ALL_ALLOWED'] / ['ALL_DIRECT'] / ['ALL_GROUPS'] / ['ALL_OFFICIAL']."
    • addedInput schema / properties / chat_type
      Added value: +{
      +  "default": "all",
      +  "description": "Optional session type filter ('all', 'direct', 'group', 'official').",
      +  "enum": [
      +    "all",
      +    "group",
      +    "direct",
      +    "official"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / fresh / description
      Added value: +"Force immediate SQLCipher decryption and SQLite snapshot refresh."
    • changedInput schema / properties / limit_per_chat / description
      Previous value: -"Max messages per group chat (default 500, max 3000)."New value: +"Max messages per chat session (default 500, max 3000)."
  2. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds substantial behavioral detail beyond annotations: automatic 4-tier name resolution, @mention handling, reply-chain rendering, revoked-message filtering, and context-buffer prepending. It does not mention permissions or rate limits, but the behavioral disclosure is strong.

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 a single dense sentence that front-loads the core purpose and retrieval modes, with no filler. It could be split for readability, but every clause adds a concrete behavioral detail.

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?

For a complex 10-parameter fetch tool with no output schema, the description covers the core operation, retrieval modes, and significant post-processing behavior. It omits return-shape details and caveats such as result-size behavior, but annotations already cover the safety profile and the schema covers most parameter details.

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

Parameters3/5

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

Schema description coverage is 90%, so the schema already documents nearly all parameters. The description only elaborates on after_msg_id, since, and context buffer, while leaving the remaining parameter semantics to the schema. This matches the baseline 3 when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'Fetch cleaned WeChat messages' across direct chats, group chats, and official accounts. It also names the two retrieval modes, incremental cursor and time window. It does not explicitly distinguish itself from sibling tools such as wechat_search_messages, so it falls short of a 5.

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

Usage Guidelines3/5

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

The description implies usage through retrieval modes and chat scopes, but it never says when to choose this tool over wechat_search_messages or when not to use it. There are no explicit alternatives, exclusions, or prerequisite guidance.

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