Skip to main content
Glama

forward_message

Forward a specific message to a different chat or user by specifying the target ID and its type (chat, open, union, user, or email).

Instructions

[Official API] Forward a message to another chat or user. receive_id may be a group chat_id (oc_xxx), an open_id (ou_xxx), a union_id, a user_id, or an email — set receive_id_type to match (default: chat_id).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idYesMessage ID to forward (om_xxx)
receive_idYesTarget chat_id (oc_xxx), open_id (ou_xxx), union_id, user_id, or email — set receive_id_type to match.
receive_id_typeNoFormat of receive_id (default: chat_id). Set to "open_id" when forwarding to a user via their open_id.chat_id

Implementation Reference

  • Handler for forward_message: auto-detects receive_id_type based on ID prefix (ou_→open_id, on_→union_id, @→email, else chat_id), then calls ctx.getOfficialClient().forwardMessage() to forward the message.
    async forward_message(args, ctx) {
      // Auto-detect receive_id_type when not provided so callers can pass an open_id
      // (ou_xxx) without having to set the type field — matches what
      // send_to_user/send_to_group already do for chat resolution.
      let receiveIdType = args.receive_id_type;
      if (!receiveIdType) {
        const id = args.receive_id || '';
        if (id.startsWith('ou_')) receiveIdType = 'open_id';
        else if (id.startsWith('on_')) receiveIdType = 'union_id';
        else if (id.includes('@')) receiveIdType = 'email';
        else receiveIdType = 'chat_id';
      }
      return text(`Forwarded: ${(await ctx.getOfficialClient().forwardMessage(args.message_id, args.receive_id, receiveIdType)).messageId}`);
    },
  • Schema definition for the forward_message tool with input validation (message_id, receive_id required; receive_id_type optional with enum).
    {
      name: 'forward_message',
      description: '[Official API] Forward a message to another chat or user. `receive_id` may be a group chat_id (oc_xxx), an open_id (ou_xxx), a union_id, a user_id, or an email — set `receive_id_type` to match (default: chat_id).',
      inputSchema: {
        type: 'object',
        properties: {
          message_id: { type: 'string', description: 'Message ID to forward (om_xxx)' },
          receive_id: { type: 'string', description: 'Target chat_id (oc_xxx), open_id (ou_xxx), union_id, user_id, or email — set receive_id_type to match.' },
          receive_id_type: { type: 'string', enum: ['chat_id', 'open_id', 'union_id', 'user_id', 'email'], description: 'Format of receive_id (default: chat_id). Set to "open_id" when forwarding to a user via their open_id.', default: 'chat_id' },
        },
        required: ['message_id', 'receive_id'],
      },
    },
  • src/server.js:56-57 (registration)
    Tool registration: messaging-bot module is loaded in TOOL_MODULES (line 47), its schemas are flattened into the tools list, and handlers (including forward_message) are indexed by name for dispatch via CallToolRequestSchema.
    const TOOLS = TOOL_MODULES.flatMap((m) => m.schemas);
    const HANDLERS = Object.fromEntries(TOOL_MODULES.flatMap((m) => Object.entries(m.handlers)));
  • Low-level Feishu API wrapper: calls im.message.forward SDK method with message_id path, receive_id data, and receive_id_type param. Returns the new messageId.
    async forwardMessage(messageId, receiverId, receiveIdType = 'chat_id') {
      const res = await this._safeSDKCall(
        () => this.client.im.message.forward({
          path: { message_id: messageId },
          data: { receive_id: receiverId },
          params: { receive_id_type: receiveIdType },
        }),
        'forwardMessage'
      );
      return { messageId: res.data.message_id };
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Forward a message' implying mutation but does not disclose side effects, permissions required, or limitations (e.g., whether all message types can be forwarded). The description is insufficient for an agent to understand behavioral traits.

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 a single, focused sentence that front-loads the purpose. No extraneous information, efficient and clear.

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

Completeness3/5

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

Given the tool has 3 parameters, no output schema, and no annotations, the description covers the essential purpose and parameter usage. However, it lacks behavioral context (e.g., repercussions of forwarding, rate limits, permissions) which an agent might need for safe invocation.

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 coverage is 100%, so baseline is 3. The description adds value by clarifying receive_id types and default behavior, but does not provide additional semantics beyond what the schema already specifies.

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 clearly states the tool forwards a message to another chat or user, specifying the verb and resource. However, it does not explicitly differentiate from sibling tools like send_message_as_bot or reply_message, though the action is distinct.

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 provides guidance on setting receive_id_type to match the format, but lacks explicit when-to-use or when-not-to-use instructions. The purpose is implied, but no alternatives are mentioned.

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/EthanQC/feishu-user-plugin'

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