feat: add tg_send_photo and tg_send_file media tools#1
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds media sending: photos and files/documents.
Changes
tg_send_phototool — send an image as an inline (compressed) Telegram phototg_send_filetool — send any file as a document withForceFile(exact bytes, no recompression)getInputPeerFromNamefor peer resolution and gotd/td'suploader+message.Sender; support optionalcaptionandreply_toMotivation
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 ./...,gofmtclean (no test files in repo)tg_send_photo(inline image) andtg_send_file(document) delivered successfully to a real dialog; caption verified