Commit graph

119 commits

Author SHA1 Message Date
Bayram Annakov
d504e5fa45
Update main.py
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:47:05 -08:00
Bayram Annakov
700c01b2d3
Update main.py
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:46:59 -08:00
Bayram Annakov
fe8dcb3797
Update main.py
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:46:53 -08:00
Bayram Annakov
adc6ef4c7c
Update main.py
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:46:46 -08:00
Bayram Annakov
041bf0dbec
Update main.py
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:46:38 -08:00
Bayram Annakov
78a21ef2d0
Update main.py
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:46:31 -08:00
Bayram Annakov
943f66a67c
Apply suggestions from code review
Co-authored-by: Eugene Evstafev <36392751+chigwell@users.noreply.github.com>
2025-12-26 13:45:28 -08:00
Bayram Annakov
6b1f4cda85 fix: detect manually marked unread chats in list_chats
Previously list_chats only checked dialog.unread_count, missing chats
that were manually marked as unread via Telegram's "mark as unread" feature.

Now also checks dialog.dialog.unread_mark flag:
- unread_count > 0: shows "Unread: N"
- unread_mark = True: shows "Unread: marked"

This matches the behavior of Telegram's "Unread" folder filter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 19:17:22 -08:00
Eugene Evstafev
4b077c708e
Merge pull request #44 from l1v0n1/docs/add-invite-to-group-to-readme
docs: add invite_to_group function to README
2025-12-25 19:41:41 +00:00
anonim
2ac8b93650 docs: add invite_to_group function to README
Add invite_to_group function to the Chat & Group Management section
of the README. This function exists in main.py with @mcp.tool() decorator
but was missing from the documentation.
2025-12-25 22:39:16 +03:00
Eugene Evstafev
c76e1a27a7
Merge pull request #43 from chigwell/l1v0n1-patch-1
docs: add message reaction tools to README
2025-12-25 19:26:22 +00:00
Kamil
a7baa31ab6
docs: add message reaction tools to README
Add documentation for three new message reaction tools from PR #41:

- send_reaction(chat_id, message_id, emoji, big=False): Add a reaction to a message
- remove_reaction(chat_id, message_id): Remove a reaction from a message
- get_message_reactions(chat_id, message_id, limit=50): Get all reactions on a message

These tools are now part of the Messaging section in the features list.
2025-12-25 22:23:26 +03:00
Eugene Evstafev
24a07d1f4f
Merge pull request #41 from dmitry-simple-it/feat/message-reactions
feat: add message reactions support
2025-12-23 17:00:55 +00:00
Dmitrii Zolotukhin
7a9ee58c71 feat: add message reactions support
Add three new MCP tools for handling Telegram message reactions:
- send_reaction: Send emoji reaction to a message
- remove_reaction: Remove your reaction from a message
- get_message_reactions: Get list of reactions on a message

All tools include proper ToolAnnotations and follow existing code patterns.
2025-12-23 19:55:54 +03:00
Eugene Evstafev
fcadc0f3c7
Merge pull request #40 from triepod-ai/feat/add-title-annotations
feat: Add title annotations to all 78 tools for improved LLM display
2025-12-23 14:02:12 +00:00
triepod-ai
49d70795f0 feat: Add title annotations to all 78 tools for improved LLM display
Add human-readable title annotations to all MCP tools to help clients
display tool names in a user-friendly format.

Changes:
- Added title annotation to all 78 tools (e.g., "Get Chats", "Send Message")
- Formatted with Black for code style consistency

This improves the user experience when MCP clients display tool lists.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-23 07:55:43 -06:00
Eugene Evstafev
83c2c73a3b
Merge pull request #35 from uriyyo/main
Add ability to run telegram-mcp using uvx
2025-12-19 09:08:31 +00:00
Yurii Karabas
92a0dc31b5 fix lint errors 2025-12-18 23:47:12 +01:00
Yurii Karabas
7e2f4427e5
Merge branch 'chigwell:main' into main 2025-12-19 00:44:44 +02:00
Eugene Evstafev
0cb7b74ee5
Merge pull request #38 from dmitry-simple-it/fix/update-mcp-for-tool-annotations
fix: update uv.lock to resolve ToolAnnotations import error
2025-11-27 19:16:33 +00:00
Dmitrii Zolotukhin
f5bf9d1a24 fix: update uv.lock to resolve ToolAnnotations import error
Fixes #37

The mcp package was locked at version 1.6.0 which does not include
the ToolAnnotations type. This caused the server to fail on startup
with:

  ImportError: cannot import name 'ToolAnnotations' from 'mcp.types'

Updated mcp from 1.6.0 to 1.22.0 which includes ToolAnnotations
and is compatible with the code added in PR #34.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 22:13:08 +03:00
Yurii Karabas
603119073a Add scripts entrypoint to run telegram-mcp using uvx 2025-11-22 14:22:13 +01:00
Eugene Evstafev
6fca222f42
Merge pull request #34 from strato-space/feat/tool-annotations
feat: add comprehensive ToolAnnotations to all MCP tools
2025-11-18 15:00:50 +00:00
Valeriy_Pavlovich
be12812c62 black: reformatted main.py 2025-11-14 01:08:37 +03:00
Valeriy_Pavlovich
1c71806082 feat: add comprehensive ToolAnnotations to all MCP tools
- Add openWorldHint=True to all 63+ @mcp.tool decorators
- Add readOnlyHint=True to read-only operations (get/list/search/export functions)
- Add destructiveHint=True to state-changing operations (send/create/delete/edit functions)
- Add idempotentHint=True to safely repeatable operations (block/unblock/pin/unpin/ban/unban/etc.)
- Fix syntax errors: openWorldHint(True) → openWorldHint=True
- Remove incorrect idempotentHint from non-idempotent operations (send_file, press_inline_button, import_contacts)

These annotations help MCP clients understand tool behavior:
- readOnlyHint: tool doesn't modify environment
- destructiveHint: tool performs destructive updates
- idempotentHint: repeated calls with same args have no additional effect
- openWorldHint: tool interacts with external entities (Telegram API)

Improves tool discoverability and helps AI agents make better decisions about tool usage.
2025-11-14 00:26:35 +03:00
Valeriy Pavlovich
57b6ef44f8
Merge pull request #1 from chigwell/main
22 commits behind chigwell/telegram-mcp:main.
2025-11-13 01:33:19 +03:00
Eugene Evstafev
ac284bcd4e
Merge pull request #32 from Latand/feature/inline-buttons-subscribe
Add inline button helpers and channel subscription tool
2025-11-05 10:28:55 +00:00
latand
b5ac2c0445 Format main.py with black 2025-11-05 12:17:21 +02:00
latand
c3594795cd Add inline button helpers and channel subscription tool 2025-11-04 20:56:04 +02:00
Eugene Evstafev
66ae9f6f8e
Merge pull request #23 from korjavin/feature/id-validation-decorator
Feature/id validation decorator
2025-10-22 16:28:21 +01:00
Korzhavin Ivan
62a3fd68be fix: undefined variable _id in unarchive_chat function
Fixed undefined variable '_id' in unarchive_chat function by
changing it to 'chat_id' which is the correct parameter name.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 09:34:48 +02:00
Korzhavin Ivan
994a49faba style: format code with black 2025-10-20 01:06:06 +02:00
Korzhavin Ivan
80245bcdc9 fix: resolve stash conflict 2025-10-20 01:01:13 +02:00
Korzhavin Ivan
f8a8b581f4 fix: merge conflict 2025-10-20 01:00:55 +02:00
Eugene Evstafev
97884fd1c1
Merge pull request #24 from korjavin/main
Refactor error logging in main.py to structured JSON format with backward compatibility
2025-10-19 17:16:57 +01:00
Korzhavin Ivan
cbe429b474 Merge branch 'main' of https://github.com/chigwell/telegram-mcp into feature/id-validation-decorator
Resolved conflict in log_and_format_error function by:
- Combining ErrorCategory enum (from main) with user_message parameter (from feature branch)
- Supporting both ErrorCategory and string prefixes (for validation errors)
- Keeping validation decorator functionality intact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:23:15 +02:00
Korzhavin Ivan
2a7134be39 fix: Apply Black formatting to pass CI checks
Applied Black code formatting to main.py to resolve linting
failures in GitHub Actions for PR #24.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:19:34 +02:00
Korzhavin Ivan
251be7219d chore: Add Black and flake8 as dev dependencies
Added Black and flake8 to development dependencies to ensure
consistent code formatting and linting across the project.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:18:32 +02:00
Korzhavin Ivan
6bbeae8c98 fix: Apply Black formatting to pass CI checks
Applied Black code formatting to main.py and test_validation.py
to resolve linting failures in GitHub Actions.

Changes include:
- Proper line breaking for long lines
- Consistent quote style (single to double quotes)
- Better formatting of return statements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 15:18:05 +02:00
Eugene Evstafev
eb6a6d0ff2
Merge pull request #30 from Marenz/poll
feat: add poll creation functionality
2025-10-17 16:39:36 +01:00
Mathias L. Baumann
7f078dd1e7 feat: add poll creation functionality
- Implement create_poll tool using Telethon's native poll API
- Support for multiple choice, quiz mode, public votes, and close dates
2025-10-17 17:32:14 +02:00
Eugene Evstafev
e7995ae001
Merge pull request #31 from strato-space/feat/list_topics
feat: Add forum topics support with `list_topics` tool
2025-10-16 10:27:11 +01:00
Valeriy Pavlovich
aa6d2761ce feat: Add forum topics support with list_topics tool
Add new list_topics() MCP tool to retrieve forum topics from Telegram
supergroups with forum feature enabled.

Features:
- Validates chat is a supergroup with forum enabled
- Supports pagination via offset_topic parameter
- Supports search filtering via search_query parameter
- Returns comprehensive topic metadata:
  * Topic ID and title
  * Total messages and unread count
  * Status flags (closed, hidden)
  * Last activity timestamp
- Proper error handling and logging

Documentation:
- Added list_topics to README Messaging tools list
- Added complete code example with implementation
- Added example output showing typical usage

Uses Telethon's GetForumTopicsRequest API for reliable forum topic
retrieval from supergroups.
2025-10-14 15:39:00 +03:00
Eugene Evstafev
da3f3ec524
Merge pull request #28 from strato-space/main
fix: make list_messages respect date/search limits (#27)
2025-10-13 20:12:27 +01:00
Valeriy Pavlovich
f08667c47a Format main.py with Black 2025-10-13 21:20:24 +03:00
Valeriy Pavlovich
553125cd76 Make list_messages predictable and efficient for date ranges and search: avoid over-fetch, apply limit after filtering, and separate search from date offsets #27
- stream search results via `client.iter_messages()` and apply date bounds in-code so we collect up to `limit` matches
- use server-side iteration for date-only queries with inclusive upper bounds to avoid over-fetching
- keep the existing `get_messages()` fast path when no filters are provided
2025-10-12 07:14:25 +03:00
Korjavin Ivan
127c953801
Merge pull request #1 from korjavin/feature/structured-json-logging
Implement Structured JSON Error Logging
2025-09-06 22:32:57 +02:00
google-labs-jules[bot]
50b01ca494 feat: implement structured JSON error logging
- Add python-json-logger dependency.
- Configure file handler to use JsonFormatter for structured logging.
- Keep console handler with the existing text format.
- Refactor log_and_format_error to log a dictionary with structured error data.
2025-09-01 14:39:30 +00:00
Eugene Evstafev
3cd0489769
Merge pull request #22 from korjavin/feature/error-code-enum
refactor: Replace hardcoded error prefixes with an Enum
2025-08-30 23:07:10 +01:00
Eugene Evstafev
b15c3e7b29
Merge pull request #21 from korjavin/main
Fix run how-to to use uv for consistency with production case
2025-08-30 23:06:09 +01:00