Skip to content

Commit 63e14b3

Browse files
committed
[FIX] core: minimal fix for module namespace shadowing
Rename contacts and groups parameters in import_contacts and create_folder to avoid shadowing global module names. This focuses the PR on the core hexagonal refactor without expanding the scope to DTOs.
1 parent d175bcb commit 63e14b3

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,7 @@ test_issues_report.md
200200
test_upload.txt
201201
test_voice.ogg
202202
sticker.webp
203-
two.png
203+
two.png
204+
205+
# Local scratch directories
206+
.local/

src/telegram_mcp/mcp_server.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -547,11 +547,11 @@ async def set_privacy_settings(
547547
@mcp.tool(
548548
annotations=ToolAnnotations(title="Import Contacts", openWorldHint=True, destructiveHint=True)
549549
)
550-
async def import_contacts(contacts: list) -> str:
550+
async def import_contacts(contacts_list: list) -> str:
551551
"""
552552
Import a list of contacts. Each contact should be a dict with phone, first_name, last_name.
553553
"""
554-
return await contacts_module.import_contacts(contacts)
554+
return await contacts_module.import_contacts(contacts_list)
555555

556556

557557
@mcp.tool(
@@ -1315,9 +1315,9 @@ async def create_folder(
13151315
title: str,
13161316
emoticon: Optional[str] = None,
13171317
chat_ids: Optional[List[Union[int, str]]] = None,
1318-
contacts: bool = False,
1318+
include_contacts: bool = False,
13191319
non_contacts: bool = False,
1320-
groups: bool = False,
1320+
include_groups: bool = False,
13211321
broadcasts: bool = False,
13221322
bots: bool = False,
13231323
exclude_muted: bool = False,
@@ -1331,9 +1331,9 @@ async def create_folder(
13311331
title: Folder name (required)
13321332
emoticon: Folder emoji (optional, e.g., "📁", "🏠", "💼")
13331333
chat_ids: List of chat IDs or usernames to include (optional)
1334-
contacts: Include all contacts
1334+
include_contacts: Include all contacts
13351335
non_contacts: Include all non-contacts
1336-
groups: Include all groups
1336+
include_groups: Include all groups
13371337
broadcasts: Include all channels
13381338
bots: Include all bots
13391339
exclude_muted: Exclude muted chats
@@ -1344,9 +1344,9 @@ async def create_folder(
13441344
title,
13451345
emoticon,
13461346
chat_ids,
1347-
contacts,
1347+
include_contacts,
13481348
non_contacts,
1349-
groups,
1349+
include_groups,
13501350
broadcasts,
13511351
bots,
13521352
exclude_muted,

0 commit comments

Comments
 (0)