Skip to content

feat(feishu): support tables, table operations, image upload, and color text in doc tools #26222

@Elarwei001

Description

@Elarwei001

Problem

The feishu_doc tool only supported plain text and basic formatting. GFM tables, inline images, table manipulation, and text color were not supported.

Implemented (PR #26790)

Markdown rendering

  • GFM tables now render as native Feishu tables via the Convert API (block types 31/32)
  • Adaptive column widths based on cell content (CJK chars weighted 2x)
  • Nested lists at any depth
  • Documents >1000 blocks are automatically split into batches

New actions

Action Description
upload_image Insert image from URL, data URI, local file path, or base64 string
color_text Apply color/bold to a text block using [red]text[/red] markup
insert_table_row / insert_table_column Insert row or column at given index
delete_table_rows / delete_table_columns Delete rows or columns
merge_table_cells Merge a rectangular cell range

Image upload notes

  • drive_route_token: When parent_node is a document block ID, the API requires passing extra: { drive_route_token: docToken }. Per the API docs, certain upload scenarios require providing the token of the cloud document that the block belongs to.
  • Buffer must be passed directly to the upload form — using Readable.from() causes Content-Length mismatch
  • File path detection uses path.isAbsolute() instead of checking for /, since standard base64 alphabet includes /

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions