Skip to content

feat: expose filename on list_messages / get_message_context #217

Description

@fenrith

Feature request: expose filename on message tools

list_messages / get_message_context return media_type for document
attachments, but not the original filename. The bridge does store it
(messages.filename in messages.db, populated from Message.filename /
msg_to_dict in whatsapp.py), it's just not included in the dict returned
to MCP clients — msg_to_dict
only re-exposes filename when media_type == "reaction" (as
reaction_to_message_id).

Use case: filtering/identifying documents by type (e.g. "find PDFs sent
to this group") currently requires knowing the media is a generic
"document" and then reading messages.db directly to get the actual
filename/extension — which works, but means going around the MCP interface
entirely for something the data already has.

Suggestion: add filename to the msg_to_dict output for non-reaction
media types (it's already there in the Message dataclass, so this looks
like a small change), or alternatively expose it via a small addition to
download_media's response.

Happy to open a PR if a maintainer confirms this is a change you'd want —
wasn't sure if filename was deliberately withheld for privacy/size reasons
in the current design.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions