SuperAPI AI Directory

feishu-im-file-send

General & other

View repository

Updated 10-16 09:44

About this skill

Fixed workflow for sending Feishu IM files

Applicable scenarios

  • The user explicitly requests to send docx/pdf/xlsx/ppt as a Feishu chat attachment .
  • The user mentions "cannot receive the file in Feishu" or "it was only written to the document and not pushed to the chat".

Mandatory rules (must be followed)

  1. Only use feishu_media to send chat attachments; the action is fixed as upload_and_send_file。
  2. Prohibited to use message 's filePath to send files to Feishu (that path is not the main path for Feishu attachments).
  3. Prohibited to use feishu_doc 's upload_file instead of sending an attachment in the chat (it only writes the attachment into a document block).
  4. The parameter name must be file_path(underscore), and it must be an absolute path readable at runtime.
  5. After sending, the reply must include the key fields of the send result:ok、fileKey(at least fileKey)。

Execution steps

  1. Confirm that the artifact file actually exists (for example output/report.docx)。
  2. Download/copy it to a locally readable absolute path (for example /tmp/report.docx)。
  3. Call feishu_media:
    • action: "upload_and_send_file"
    • to: for group chats use chat:<chat_id>; for private chats use open_id:<open_id>
    • file_path: /tmp/report.docx
    • file_name: report.docx(optional but recommended)
  4. Check the tool return; if it fails, return a clear error message and do not claim "sent".

Standard invocation example

{
  "action": "upload_and_send_file",
  "to": "chat:oc_xxx",
  "file_path": "/tmp/report.docx",
  "file_name": "report.docx"
}

Failure handling

  • If it returns schema is invalid: check whether filePath was mistakenly used or the parameter was placed at the wrong level, and change it to file_path。
  • If an account/permission error is returned: indicate the specific account and permission issue, and keep the file path for retry.
  • If the file does not exist: first go back to the artifact generation step to complete the file, then resend the attachment.