Skip to content

feat: add tg_send_photo and tg_send_file media tools#1

Merged
aogoro merged 1 commit into
mainfrom
task/media
May 31, 2026
Merged

feat: add tg_send_photo and tg_send_file media tools#1
aogoro merged 1 commit into
mainfrom
task/media

Conversation

@aogoro
Copy link
Copy Markdown
Owner

@aogoro aogoro commented May 31, 2026

Adds media sending: photos and files/documents.

Changes

  • tg_send_photo tool — send an image as an inline (compressed) Telegram photo
  • tg_send_file tool — send any file as a document with ForceFile (exact bytes, no recompression)
  • Both reuse getInputPeerFromName for peer resolution and gotd/td's uploader + message.Sender; support optional caption and reply_to
  • Non-regular paths (missing file, directory) are rejected early with a clear error
  • README: capabilities + "Changes from upstream" updated

Motivation

Enables AI assistants/agents to attach screenshots, reports and arbitrary files to Telegram dialogs (e.g. autonomous e2e testing), not just text.

Testing

  • go build ./..., go vet ./..., gofmt clean (no test files in repo)
  • e2e via Claude Code MCP client: tg_send_photo (inline image) and tg_send_file (document) delivered successfully to a real dialog; caption verified

Add two MCP tools for sending media to Telegram dialogs:
- tg_send_photo: send an image as an inline (compressed) photo
- tg_send_file: send any file as a document (ForceFile, exact bytes)

Both reuse getInputPeerFromName for peer resolution and gotd/td's
uploader + message.Sender; support optional caption and reply_to.
Reject non-regular paths early. Update README capabilities (also
fixes the stale tg_send=draft line; tg_send sends, tg_draft drafts).
@aogoro aogoro merged commit cf6e13c into main May 31, 2026
1 check failed
@aogoro aogoro deleted the task/media branch May 31, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant