tools

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package tools provides MCP tool handlers for Telegram operations.

Index

Constants

View Source
const ServerVersionToolName = "tg_server_version"

ServerVersionToolName is the MCP tool name. Exported so tests and any future tool-allowlist (e.g. auth-bypass) can reference it without duplicating the literal.

Variables

View Source
var ErrEmojiRequired = errors.New("emoji is required")

ErrEmojiRequired is returned when an emoji parameter is missing.

View Source
var ErrFirstNameRequired = errors.New("first name is required")

ErrFirstNameRequired is returned when a first name parameter is missing.

View Source
var ErrFolderIDRequired = errors.New("folder ID is required")

ErrFolderIDRequired is returned when a folder ID parameter is missing.

View Source
var ErrGroupRequired = errors.New("group is required")

ErrGroupRequired is returned when a group parameter is missing.

View Source
var ErrInvalidSlowmode = errors.New(
	"invalid slowmode seconds; allowed: 0,10,30,60,300,900,3600,21600,43200",
)

ErrInvalidSlowmode is returned when seconds is not an allowed Telegram slowmode value.

View Source
var ErrLinkRequired = errors.New("link is required")

ErrLinkRequired is returned when a link parameter is missing.

View Source
var ErrMessageIDRequired = errors.New("message ID is required")

ErrMessageIDRequired is returned when a message ID parameter is missing.

View Source
var ErrMessageNotFound = errors.New("message not found")

ErrMessageNotFound is returned when a message cannot be found.

View Source
var ErrNameRequired = errors.New("name is required")

ErrNameRequired is returned when a name parameter is missing.

View Source
var ErrNegativeLimit = errors.New("numeric limits must not be negative")

ErrNegativeLimit is returned when a numeric limit parameter is negative.

View Source
var ErrParseModeNotImplemented = errors.New(
	"parseMode not yet implemented; use 'commonmark' (supports **bold**, *italic*, `code`, [text](url), ```pre```, > quote)",
)

ErrParseModeNotImplemented is returned when parseMode is a valid value whose implementation is not yet available.

View Source
var ErrPathOutsideRoots = errors.New("file path is not within any client root directory")

ErrPathOutsideRoots is returned when a file path is not within any client root.

View Source
var ErrPathRequired = errors.New("path is required")

ErrPathRequired is returned when a file path parameter is missing.

View Source
var ErrPathsRequired = errors.New("paths list is required")

ErrPathsRequired is returned when a paths list parameter is missing.

View Source
var ErrPeerRequired = errors.New("peer is required")

ErrPeerRequired is returned when a peer parameter is missing.

View Source
var ErrQueryRequired = errors.New("query is required")

ErrQueryRequired is returned when a search query parameter is missing.

View Source
var ErrStickerFileIDRequired = errors.New("sticker file ID is required")

ErrStickerFileIDRequired is returned when a sticker file ID parameter is missing.

View Source
var ErrTelegram = errors.New("telegram request error")

ErrTelegram indicates a failure communicating with the Telegram API.

View Source
var ErrTextRequired = errors.New("text is required")

ErrTextRequired is returned when a text parameter is missing.

View Source
var ErrTitleRequired = errors.New("title is required")

ErrTitleRequired is returned when a title parameter is missing.

View Source
var ErrTooManyIDs = errors.New("too many IDs (max 100)")

ErrTooManyIDs is returned when too many message IDs are provided.

View Source
var ErrTopicIDOnNonForum = errors.New(
	"topicId is only valid for forum-enabled supergroups; this chat is not a forum",
)

ErrTopicIDOnNonForum is returned when topicId is supplied for a chat that is not a forum-enabled supergroup.

View Source
var ErrTopicIDRequired = errors.New("topic ID is required")

ErrTopicIDRequired is returned when a topic ID parameter is missing.

View Source
var ErrUnknownParseMode = errors.New(
	"unknown parseMode; allowed: '' (plain), 'commonmark', 'markdown' (alias for commonmark), 'html', 'markdownv2'",
)

ErrUnknownParseMode is returned when parseMode is a value the wrapper does not recognise.

View Source
var ErrUserPeerRequired = errors.New("this operation requires a user peer, not a group or channel")

ErrUserPeerRequired is returned when a user peer is needed but another type was provided.

View Source
var ErrUserRequired = errors.New("user is required")

ErrUserRequired is returned when a user parameter is missing.

View Source
var ErrValidation = errors.New("validation error")

ErrValidation indicates invalid parameters provided by the caller.

Functions

func AddTool added in v0.9.4

func AddTool[In, Out any](
	server *mcp.Server,
	registry BoolFieldRegistry,
	tool *mcp.Tool,
	handler mcp.ToolHandlerFor[In, Out],
)

AddTool wraps mcp.AddTool, additionally recording the JSON names of every bool / *bool field on the In type into registry under the tool's name. The registry is later used by the bool-coercion middleware to rewrite string-encoded booleans (e.g. "true") into real JSON booleans before the SDK validator runs.

func ChatsAdminsTool

func ChatsAdminsTool() *mcp.Tool

ChatsAdminsTool returns the MCP tool definition for tg_chats_get_admins.

func ChatsArchiveTool

func ChatsArchiveTool() *mcp.Tool

ChatsArchiveTool returns the MCP tool definition for tg_chats_archive.

func ChatsCreateTool

func ChatsCreateTool() *mcp.Tool

ChatsCreateTool returns the MCP tool definition for tg_chats_create.

func ChatsDeleteTool

func ChatsDeleteTool() *mcp.Tool

ChatsDeleteTool returns the MCP tool definition for tg_chats_delete.

func ChatsMuteTool

func ChatsMuteTool() *mcp.Tool

ChatsMuteTool returns the MCP tool definition for tg_chats_mute.

func ChatsPermissionsTool

func ChatsPermissionsTool() *mcp.Tool

ChatsPermissionsTool returns the MCP tool definition for tg_chats_set_permissions.

func ChatsSetDescriptionTool

func ChatsSetDescriptionTool() *mcp.Tool

ChatsSetDescriptionTool returns the MCP tool definition for tg_chats_set_description.

func ChatsSetPhotoTool

func ChatsSetPhotoTool() *mcp.Tool

ChatsSetPhotoTool returns the MCP tool definition for tg_chats_set_photo.

func ContactsAddTool added in v0.6.0

func ContactsAddTool() *mcp.Tool

ContactsAddTool returns the tool definition for tg_contacts_add.

func ContactsDeleteTool added in v0.6.0

func ContactsDeleteTool() *mcp.Tool

ContactsDeleteTool returns the tool definition for tg_contacts_delete.

func ContactsGetStatusesTool added in v0.6.0

func ContactsGetStatusesTool() *mcp.Tool

ContactsGetStatusesTool returns the tool definition.

func ContactsGetTool

func ContactsGetTool() *mcp.Tool

ContactsGetTool returns the MCP tool definition for tg_contacts_get.

func ContactsListBlockedTool added in v0.6.0

func ContactsListBlockedTool() *mcp.Tool

ContactsListBlockedTool returns the tool definition.

func ContactsSearchTool

func ContactsSearchTool() *mcp.Tool

ContactsSearchTool returns the MCP tool definition for tg_contacts_search.

func DialogsGetInfoTool

func DialogsGetInfoTool() *mcp.Tool

DialogsGetInfoTool returns the MCP tool definition for tg_dialogs_get_info.

func DialogsListTool

func DialogsListTool() *mcp.Tool

DialogsListTool returns the MCP tool definition for tg_dialogs_list.

func DialogsMarkUnreadTool added in v0.6.0

func DialogsMarkUnreadTool() *mcp.Tool

DialogsMarkUnreadTool returns the tool definition for tg_dialogs_mark_unread.

func DialogsPinTool added in v0.6.0

func DialogsPinTool() *mcp.Tool

DialogsPinTool returns the tool definition for tg_dialogs_pin.

func DialogsSearchTool

func DialogsSearchTool() *mcp.Tool

DialogsSearchTool returns the MCP tool definition for tg_dialogs_search.

func DraftsClearTool

func DraftsClearTool() *mcp.Tool

DraftsClearTool returns the MCP tool definition for tg_drafts_clear.

func DraftsSetTool

func DraftsSetTool() *mcp.Tool

DraftsSetTool returns the MCP tool definition for tg_drafts_set.

func FoldersCreateTool

func FoldersCreateTool() *mcp.Tool

FoldersCreateTool returns the MCP tool definition for tg_folders_create.

func FoldersDeleteTool

func FoldersDeleteTool() *mcp.Tool

FoldersDeleteTool returns the MCP tool definition for tg_folders_delete.

func FoldersEditTool

func FoldersEditTool() *mcp.Tool

FoldersEditTool returns the MCP tool definition for tg_folders_edit.

func FoldersListTool

func FoldersListTool() *mcp.Tool

FoldersListTool returns the MCP tool definition for tg_folders_list.

func FormatMessageList added in v0.13.0

func FormatMessageList(msgs []telegram.Message) string

FormatMessageList renders a slice of domain messages in the same multi-line block format the tool surface uses. Exported so other packages (resources) can produce identical output without duplicating the layout rules.

func GroupsAdminSetTool added in v0.6.0

func GroupsAdminSetTool() *mcp.Tool

GroupsAdminSetTool returns the tool definition for tg_groups_admin_set.

func GroupsInfoTool

func GroupsInfoTool() *mcp.Tool

GroupsInfoTool returns the MCP tool definition for tg_groups_info.

func GroupsInviteLinkGetTool

func GroupsInviteLinkGetTool() *mcp.Tool

GroupsInviteLinkGetTool returns the MCP tool definition for tg_groups_invite_link_get.

func GroupsInviteLinkRevokeTool

func GroupsInviteLinkRevokeTool() *mcp.Tool

GroupsInviteLinkRevokeTool returns the MCP tool definition for tg_groups_invite_link_revoke.

func GroupsJoinTool

func GroupsJoinTool() *mcp.Tool

GroupsJoinTool returns the MCP tool definition for tg_groups_join.

func GroupsLeaveTool

func GroupsLeaveTool() *mcp.Tool

GroupsLeaveTool returns the MCP tool definition for tg_groups_leave.

func GroupsListTool

func GroupsListTool() *mcp.Tool

GroupsListTool returns the MCP tool definition for tg_groups_list.

func GroupsMembersAddTool

func GroupsMembersAddTool() *mcp.Tool

GroupsMembersAddTool returns the MCP tool definition for tg_groups_members_add.

func GroupsMembersListTool added in v0.6.0

func GroupsMembersListTool() *mcp.Tool

GroupsMembersListTool returns the tool definition.

func GroupsMembersRemoveTool

func GroupsMembersRemoveTool() *mcp.Tool

GroupsMembersRemoveTool returns the MCP tool definition for tg_groups_members_remove.

func GroupsRenameTool

func GroupsRenameTool() *mcp.Tool

GroupsRenameTool returns the MCP tool definition for tg_groups_rename.

func GroupsSlowmodeTool added in v0.6.0

func GroupsSlowmodeTool() *mcp.Tool

GroupsSlowmodeTool returns the tool definition for tg_groups_slowmode.

func MediaDownloadTool

func MediaDownloadTool() *mcp.Tool

MediaDownloadTool returns the MCP tool definition for tg_media_download.

func MediaSendAlbumTool

func MediaSendAlbumTool() *mcp.Tool

MediaSendAlbumTool returns the MCP tool definition for tg_media_send_album.

func MediaUploadTool

func MediaUploadTool() *mcp.Tool

MediaUploadTool returns the MCP tool definition for tg_media_upload.

func MessagesClearAllDraftsTool added in v0.6.0

func MessagesClearAllDraftsTool() *mcp.Tool

MessagesClearAllDraftsTool returns the tool definition.

func MessagesContextTool

func MessagesContextTool() *mcp.Tool

MessagesContextTool returns the MCP tool definition for tg_messages_context.

func MessagesDeleteHistoryTool added in v0.6.0

func MessagesDeleteHistoryTool() *mcp.Tool

MessagesDeleteHistoryTool returns the tool definition.

func MessagesDeleteTool

func MessagesDeleteTool() *mcp.Tool

MessagesDeleteTool returns the MCP tool definition for tg_messages_delete.

func MessagesEditTool

func MessagesEditTool() *mcp.Tool

MessagesEditTool returns the MCP tool definition for tg_messages_edit.

func MessagesForwardTool

func MessagesForwardTool() *mcp.Tool

MessagesForwardTool returns the MCP tool definition for tg_messages_forward.

func MessagesGetReactionsTool added in v0.6.0

func MessagesGetReactionsTool() *mcp.Tool

MessagesGetReactionsTool returns the tool definition.

func MessagesGetScheduledTool added in v0.6.0

func MessagesGetScheduledTool() *mcp.Tool

MessagesGetScheduledTool returns the tool definition for tg_messages_get_scheduled.

func MessagesGetTool

func MessagesGetTool() *mcp.Tool

MessagesGetTool returns the MCP tool definition for tg_messages_get.

func MessagesListTool

func MessagesListTool() *mcp.Tool

MessagesListTool returns the MCP tool definition for tg_messages_list.

func MessagesMarkReadTool

func MessagesMarkReadTool() *mcp.Tool

MessagesMarkReadTool returns the MCP tool definition for tg_messages_mark_read.

func MessagesPinTool

func MessagesPinTool() *mcp.Tool

MessagesPinTool returns the MCP tool definition for tg_messages_pin.

func MessagesReactTool

func MessagesReactTool() *mcp.Tool

MessagesReactTool returns the MCP tool definition for tg_messages_react.

func MessagesSearchGlobalTool added in v0.6.0

func MessagesSearchGlobalTool() *mcp.Tool

MessagesSearchGlobalTool returns the tool definition.

func MessagesSearchTool

func MessagesSearchTool() *mcp.Tool

MessagesSearchTool returns the MCP tool definition for tg_messages_search.

func MessagesSendFileTool

func MessagesSendFileTool() *mcp.Tool

MessagesSendFileTool returns the MCP tool definition for tg_messages_send_file.

func MessagesSendTool

func MessagesSendTool() *mcp.Tool

MessagesSendTool returns the MCP tool definition for tg_messages_send.

func NewChatsAdminsHandler

func NewChatsAdminsHandler(client telegram.Client) mcp.ToolHandlerFor[ChatsAdminsParams, ChatsAdminsResult]

NewChatsAdminsHandler creates a handler for the tg_chats_get_admins tool.

func NewChatsArchiveHandler

func NewChatsArchiveHandler(client telegram.Client) mcp.ToolHandlerFor[ChatsArchiveParams, ChatsArchiveResult]

NewChatsArchiveHandler creates a handler for the tg_chats_archive tool.

func NewChatsCreateHandler

func NewChatsCreateHandler(client telegram.Client) mcp.ToolHandlerFor[ChatsCreateParams, ChatsCreateResult]

NewChatsCreateHandler creates a handler for the tg_chats_create tool.

func NewChatsDeleteHandler

func NewChatsDeleteHandler(client telegram.Client) mcp.ToolHandlerFor[ChatsDeleteParams, ChatsDeleteResult]

NewChatsDeleteHandler creates a handler for the tg_chats_delete tool.

func NewChatsMuteHandler

func NewChatsMuteHandler(client telegram.Client) mcp.ToolHandlerFor[ChatsMuteParams, ChatsMuteResult]

NewChatsMuteHandler creates a handler for the tg_chats_mute tool.

func NewChatsPermissionsHandler

func NewChatsPermissionsHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[ChatsPermissionsParams, ChatsPermissionsResult]

NewChatsPermissionsHandler creates a handler for the tg_chats_set_permissions tool.

func NewChatsSetDescriptionHandler

func NewChatsSetDescriptionHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[ChatsSetDescriptionParams, ChatsSetDescriptionResult]

NewChatsSetDescriptionHandler creates a handler for the tg_chats_set_description tool.

func NewChatsSetPhotoHandler

func NewChatsSetPhotoHandler(client telegram.Client) mcp.ToolHandlerFor[ChatsSetPhotoParams, ChatsSetPhotoResult]

NewChatsSetPhotoHandler creates a handler for the tg_chats_set_photo tool.

func NewContactsAddHandler added in v0.6.0

func NewContactsAddHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[ContactsAddParams, ContactsAddResult]

NewContactsAddHandler creates a handler for tg_contacts_add.

func NewContactsDeleteHandler added in v0.6.0

func NewContactsDeleteHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[ContactsDeleteParams, ContactsDeleteResult]

NewContactsDeleteHandler creates a handler for tg_contacts_delete.

func NewContactsGetHandler

func NewContactsGetHandler(client telegram.Client) mcp.ToolHandlerFor[ContactsGetParams, ContactsGetResult]

NewContactsGetHandler creates a handler for the tg_contacts_get tool.

func NewContactsGetStatusesHandler added in v0.6.0

func NewContactsGetStatusesHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[ContactsGetStatusesParams, ContactsGetStatusesResult]

NewContactsGetStatusesHandler creates a handler for tg_contacts_get_statuses.

func NewContactsListBlockedHandler added in v0.6.0

func NewContactsListBlockedHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[ContactsListBlockedParams, ContactsListBlockedResult]

NewContactsListBlockedHandler creates a handler for tg_contacts_list_blocked.

func NewContactsSearchHandler

NewContactsSearchHandler creates a handler for the tg_contacts_search tool.

func NewDialogsGetInfoHandler

NewDialogsGetInfoHandler creates a handler for the tg_dialogs_get_info tool.

func NewDialogsListHandler

func NewDialogsListHandler(client telegram.Client) mcp.ToolHandlerFor[DialogsListParams, DialogsListResult]

NewDialogsListHandler creates a handler for the tg_dialogs_list tool.

func NewDialogsMarkUnreadHandler added in v0.6.0

func NewDialogsMarkUnreadHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[DialogsMarkUnreadParams, DialogsMarkUnreadResult]

NewDialogsMarkUnreadHandler creates a handler for tg_dialogs_mark_unread.

func NewDialogsPinHandler added in v0.6.0

func NewDialogsPinHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[DialogsPinParams, DialogsPinResult]

NewDialogsPinHandler creates a handler for tg_dialogs_pin.

func NewDialogsSearchHandler

func NewDialogsSearchHandler(client telegram.Client) mcp.ToolHandlerFor[DialogsSearchParams, DialogsSearchResult]

NewDialogsSearchHandler creates a handler for the tg_dialogs_search tool.

func NewDraftsClearHandler

func NewDraftsClearHandler(client telegram.Client) mcp.ToolHandlerFor[DraftsClearParams, DraftsClearResult]

NewDraftsClearHandler creates a handler for the tg_drafts_clear tool.

func NewDraftsSetHandler

func NewDraftsSetHandler(client telegram.Client) mcp.ToolHandlerFor[DraftsSetParams, DraftsSetResult]

NewDraftsSetHandler creates a handler for the tg_drafts_set tool.

func NewFoldersCreateHandler

func NewFoldersCreateHandler(client telegram.Client) mcp.ToolHandlerFor[FoldersCreateParams, FoldersCreateResult]

NewFoldersCreateHandler creates a handler for the tg_folders_create tool.

func NewFoldersDeleteHandler

func NewFoldersDeleteHandler(client telegram.Client) mcp.ToolHandlerFor[FoldersDeleteParams, FoldersDeleteResult]

NewFoldersDeleteHandler creates a handler for the tg_folders_delete tool.

func NewFoldersEditHandler

func NewFoldersEditHandler(client telegram.Client) mcp.ToolHandlerFor[FoldersEditParams, FoldersEditResult]

NewFoldersEditHandler creates a handler for the tg_folders_edit tool.

func NewFoldersListHandler

func NewFoldersListHandler(client telegram.Client) mcp.ToolHandlerFor[FoldersListParams, FoldersListResult]

NewFoldersListHandler creates a handler for the tg_folders_list tool.

func NewGroupsAdminSetHandler added in v0.6.0

func NewGroupsAdminSetHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[GroupsAdminSetParams, GroupsAdminSetResult]

NewGroupsAdminSetHandler creates a handler for tg_groups_admin_set.

func NewGroupsInfoHandler

func NewGroupsInfoHandler(client telegram.Client) mcp.ToolHandlerFor[GroupsInfoParams, GroupsInfoResult]

NewGroupsInfoHandler creates a handler for the tg_groups_info tool.

func NewGroupsInviteLinkGetHandler

NewGroupsInviteLinkGetHandler creates a handler for the tg_groups_invite_link_get tool.

func NewGroupsInviteLinkRevokeHandler

func NewGroupsInviteLinkRevokeHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[GroupsInviteLinkRevokeParams, GroupsInviteLinkRevokeResult]

NewGroupsInviteLinkRevokeHandler creates a handler for the tg_groups_invite_link_revoke tool.

func NewGroupsJoinHandler

func NewGroupsJoinHandler(client telegram.Client) mcp.ToolHandlerFor[GroupsJoinParams, GroupsJoinResult]

NewGroupsJoinHandler creates a handler for the tg_groups_join tool.

func NewGroupsLeaveHandler

func NewGroupsLeaveHandler(client telegram.Client) mcp.ToolHandlerFor[GroupsLeaveParams, GroupsLeaveResult]

NewGroupsLeaveHandler creates a handler for the tg_groups_leave tool.

func NewGroupsListHandler

func NewGroupsListHandler(client telegram.Client) mcp.ToolHandlerFor[GroupsListParams, GroupsListResult]

NewGroupsListHandler creates a handler for the tg_groups_list tool.

func NewGroupsMembersAddHandler

NewGroupsMembersAddHandler creates a handler for the tg_groups_members_add tool.

func NewGroupsMembersListHandler added in v0.6.0

func NewGroupsMembersListHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[GroupsMembersListParams, GroupsMembersListResult]

NewGroupsMembersListHandler creates a handler for tg_groups_members_list.

func NewGroupsMembersRemoveHandler

func NewGroupsMembersRemoveHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[GroupsMembersRemoveParams, GroupsMembersRemoveResult]

NewGroupsMembersRemoveHandler creates a handler for the tg_groups_members_remove tool.

func NewGroupsRenameHandler

func NewGroupsRenameHandler(client telegram.Client) mcp.ToolHandlerFor[GroupsRenameParams, GroupsRenameResult]

NewGroupsRenameHandler creates a handler for the tg_groups_rename tool.

func NewGroupsSlowmodeHandler added in v0.6.0

func NewGroupsSlowmodeHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[GroupsSlowmodeParams, GroupsSlowmodeResult]

NewGroupsSlowmodeHandler creates a handler for tg_groups_slowmode.

func NewMediaDownloadHandler

func NewMediaDownloadHandler(
	client telegram.Client, defaultDownloadDir string,
) mcp.ToolHandlerFor[MediaDownloadParams, MediaDownloadResult]

NewMediaDownloadHandler creates a handler for the tg_media_download tool.

func NewMediaSendAlbumHandler

func NewMediaSendAlbumHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MediaSendAlbumParams, MediaSendAlbumResult]

NewMediaSendAlbumHandler creates a handler for the tg_media_send_album tool.

func NewMediaUploadHandler

func NewMediaUploadHandler(client telegram.Client) mcp.ToolHandlerFor[MediaUploadParams, MediaUploadResult]

NewMediaUploadHandler creates a handler for the tg_media_upload tool.

func NewMessagesClearAllDraftsHandler added in v0.6.0

func NewMessagesClearAllDraftsHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MessagesClearAllDraftsParams, MessagesClearAllDraftsResult]

NewMessagesClearAllDraftsHandler creates a handler for tg_messages_clear_all_drafts.

func NewMessagesContextHandler

NewMessagesContextHandler creates a handler for the tg_messages_context tool.

func NewMessagesDeleteHandler

NewMessagesDeleteHandler creates a handler for the tg_messages_delete tool.

func NewMessagesDeleteHistoryHandler added in v0.6.0

func NewMessagesDeleteHistoryHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MessagesDeleteHistoryParams, MessagesDeleteHistoryResult]

NewMessagesDeleteHistoryHandler creates a handler for tg_messages_delete_history.

func NewMessagesEditHandler

func NewMessagesEditHandler(client telegram.Client) mcp.ToolHandlerFor[MessagesEditParams, MessagesEditResult]

NewMessagesEditHandler creates a handler for the tg_messages_edit tool.

func NewMessagesForwardHandler

NewMessagesForwardHandler creates a handler for the tg_messages_forward tool.

func NewMessagesGetHandler

func NewMessagesGetHandler(client telegram.Client) mcp.ToolHandlerFor[MessagesGetParams, MessagesGetResult]

NewMessagesGetHandler creates a handler for the tg_messages_get tool.

func NewMessagesGetReactionsHandler added in v0.6.0

func NewMessagesGetReactionsHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MessagesGetReactionsParams, MessagesGetReactionsResult]

NewMessagesGetReactionsHandler creates a handler for tg_messages_get_reactions.

func NewMessagesGetScheduledHandler added in v0.6.0

func NewMessagesGetScheduledHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MessagesGetScheduledParams, MessagesGetScheduledResult]

NewMessagesGetScheduledHandler creates a handler for tg_messages_get_scheduled.

func NewMessagesListHandler

func NewMessagesListHandler(client telegram.Client) mcp.ToolHandlerFor[MessagesListParams, MessagesListResult]

NewMessagesListHandler creates a handler for the tg_messages_list tool.

func NewMessagesMarkReadHandler

NewMessagesMarkReadHandler creates a handler for the tg_messages_mark_read tool.

func NewMessagesPinHandler

func NewMessagesPinHandler(client telegram.Client) mcp.ToolHandlerFor[MessagesPinParams, MessagesPinResult]

NewMessagesPinHandler creates a handler for the tg_messages_pin tool.

func NewMessagesReactHandler

func NewMessagesReactHandler(client telegram.Client) mcp.ToolHandlerFor[MessagesReactParams, MessagesReactResult]

NewMessagesReactHandler creates a handler for the tg_messages_react tool.

func NewMessagesSearchGlobalHandler added in v0.6.0

func NewMessagesSearchGlobalHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MessagesSearchGlobalParams, MessagesSearchGlobalResult]

NewMessagesSearchGlobalHandler creates a handler for tg_messages_search_global.

func NewMessagesSearchHandler

NewMessagesSearchHandler creates a handler for the tg_messages_search tool.

func NewMessagesSendFileHandler

func NewMessagesSendFileHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[MessagesSendFileParams, MessagesSendFileResult]

NewMessagesSendFileHandler creates a handler for the tg_messages_send_file tool.

func NewMessagesSendHandler

func NewMessagesSendHandler(client telegram.Client) mcp.ToolHandlerFor[MessagesSendParams, MessagesSendResult]

NewMessagesSendHandler creates a handler for the tg_messages_send tool.

func NewOnlineStatusSetHandler

NewOnlineStatusSetHandler creates a handler for the tg_online_status_set tool.

func NewProfileGetHandler

func NewProfileGetHandler(client telegram.Client) mcp.ToolHandlerFor[ProfileGetParams, ProfileGetResult]

NewProfileGetHandler creates a handler for the tg_profile_get tool.

func NewProfileSetBioHandler

func NewProfileSetBioHandler(client telegram.Client) mcp.ToolHandlerFor[ProfileSetBioParams, ProfileSetBioResult]

NewProfileSetBioHandler creates a handler for the tg_profile_set_bio tool.

func NewProfileSetNameHandler

NewProfileSetNameHandler creates a handler for the tg_profile_set_name tool.

func NewProfileSetPhotoHandler

NewProfileSetPhotoHandler creates a handler for the tg_profile_set_photo tool.

func NewServerVersionHandler added in v0.11.0

func NewServerVersionHandler(
	version, revision, goVersion string,
) mcp.ToolHandlerFor[ServerVersionParams, ServerVersionResult]

NewServerVersionHandler creates a handler that reports the build metadata passed in — typically the package-level `version` and `revision` strings injected via -ldflags from the Containerfile, plus runtime.Version(). Taking these as parameters (instead of reading from the cmd package directly) avoids an internal-tool import cycle and keeps the handler trivially testable.

func NewStickersGetSetHandler

NewStickersGetSetHandler creates a handler for the tg_stickers_get_set tool.

func NewStickersSearchHandler

NewStickersSearchHandler creates a handler for the tg_stickers_search tool.

func NewStickersSendHandler

func NewStickersSendHandler(client telegram.Client) mcp.ToolHandlerFor[StickersSendParams, StickersSendResult]

NewStickersSendHandler creates a handler for the tg_stickers_send tool.

func NewTopicsCreateHandler added in v0.6.0

func NewTopicsCreateHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[TopicsCreateParams, TopicsCreateResult]

NewTopicsCreateHandler creates a handler for tg_topics_create.

func NewTopicsEditHandler added in v0.6.0

func NewTopicsEditHandler(
	client telegram.Client,
) mcp.ToolHandlerFor[TopicsEditParams, TopicsEditResult]

NewTopicsEditHandler creates a handler for tg_topics_edit.

func NewTopicsListHandler

func NewTopicsListHandler(client telegram.Client) mcp.ToolHandlerFor[TopicsListParams, TopicsListResult]

NewTopicsListHandler creates a handler for the tg_topics_list tool.

func NewTopicsSearchHandler

func NewTopicsSearchHandler(client telegram.Client) mcp.ToolHandlerFor[TopicsSearchParams, TopicsSearchResult]

NewTopicsSearchHandler creates a handler for the tg_topics_search tool.

func NewTypingSendHandler

func NewTypingSendHandler(client telegram.Client) mcp.ToolHandlerFor[TypingSendParams, TypingSendResult]

NewTypingSendHandler creates a handler for the tg_typing_send tool.

func NewUsersBlockHandler

func NewUsersBlockHandler(client telegram.Client) mcp.ToolHandlerFor[UsersBlockParams, UsersBlockResult]

NewUsersBlockHandler creates a handler for the tg_users_block tool.

func NewUsersCommonChatsHandler

NewUsersCommonChatsHandler creates a handler for the tg_users_get_common_chats tool.

func NewUsersGetHandler

func NewUsersGetHandler(client telegram.Client) mcp.ToolHandlerFor[UsersGetParams, UsersGetResult]

NewUsersGetHandler creates a handler for the tg_users_get tool.

func NewUsersPhotosHandler

func NewUsersPhotosHandler(client telegram.Client) mcp.ToolHandlerFor[UsersPhotosParams, UsersPhotosResult]

NewUsersPhotosHandler creates a handler for the tg_users_get_photos tool.

func OnlineStatusSetTool

func OnlineStatusSetTool() *mcp.Tool

OnlineStatusSetTool returns the MCP tool definition for tg_online_status_set.

func ProfileGetTool

func ProfileGetTool() *mcp.Tool

ProfileGetTool returns the MCP tool definition for tg_profile_get.

func ProfileSetBioTool

func ProfileSetBioTool() *mcp.Tool

ProfileSetBioTool returns the MCP tool definition for tg_profile_set_bio.

func ProfileSetNameTool

func ProfileSetNameTool() *mcp.Tool

ProfileSetNameTool returns the MCP tool definition for tg_profile_set_name.

func ProfileSetPhotoTool

func ProfileSetPhotoTool() *mcp.Tool

ProfileSetPhotoTool returns the MCP tool definition for tg_profile_set_photo.

func ServerVersionTool added in v0.11.0

func ServerVersionTool() *mcp.Tool

ServerVersionTool returns the MCP tool definition for tg_server_version.

func StickersGetSetTool

func StickersGetSetTool() *mcp.Tool

StickersGetSetTool returns the MCP tool definition for tg_stickers_get_set.

func StickersSearchTool

func StickersSearchTool() *mcp.Tool

StickersSearchTool returns the MCP tool definition for tg_stickers_search.

func StickersSendTool

func StickersSendTool() *mcp.Tool

StickersSendTool returns the MCP tool definition for tg_stickers_send.

func TopicsCreateTool added in v0.6.0

func TopicsCreateTool() *mcp.Tool

TopicsCreateTool returns the tool definition for tg_topics_create.

func TopicsEditTool added in v0.6.0

func TopicsEditTool() *mcp.Tool

TopicsEditTool returns the tool definition for tg_topics_edit.

func TopicsListTool

func TopicsListTool() *mcp.Tool

TopicsListTool returns the MCP tool definition for tg_topics_list.

func TopicsSearchTool

func TopicsSearchTool() *mcp.Tool

TopicsSearchTool returns the MCP tool definition for tg_topics_search.

func TypingSendTool

func TypingSendTool() *mcp.Tool

TypingSendTool returns the MCP tool definition for tg_typing_send.

func UsersBlockTool

func UsersBlockTool() *mcp.Tool

UsersBlockTool returns the MCP tool definition for tg_users_block.

func UsersCommonChatsTool

func UsersCommonChatsTool() *mcp.Tool

UsersCommonChatsTool returns the MCP tool definition for tg_users_get_common_chats.

func UsersGetTool

func UsersGetTool() *mcp.Tool

UsersGetTool returns the MCP tool definition for tg_users_get.

func UsersPhotosTool

func UsersPhotosTool() *mcp.Tool

UsersPhotosTool returns the MCP tool definition for tg_users_get_photos.

Types

type BoolFieldRegistry added in v0.9.4

type BoolFieldRegistry = map[string]map[string]struct{}

BoolFieldRegistry mirrors middleware.BoolFieldRegistry without creating a dependency on the middleware package. The cmd/mcp-tg entry point passes the same map to both packages.

type ChatsAdminsParams

type ChatsAdminsParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

ChatsAdminsParams defines the parameters for the tg_chats_get_admins tool.

type ChatsAdminsResult

type ChatsAdminsResult struct {
	Count  int        `json:"count"`
	Admins []UserItem `json:"admins"`
	Output string     `json:"output"`
}

ChatsAdminsResult is the output of the tg_chats_get_admins tool.

type ChatsArchiveParams

type ChatsArchiveParams struct {
	Peer    string `json:"peer"    jsonschema:"@username, t.me/ link, or numeric ID"`
	Archive bool   `json:"archive" jsonschema:"True to archive, false to unarchive"`
}

ChatsArchiveParams defines the parameters for the tg_chats_archive tool.

type ChatsArchiveResult

type ChatsArchiveResult struct {
	Peer     string `json:"peer"`
	Archived bool   `json:"archived"`
	Output   string `json:"output"`
}

ChatsArchiveResult is the output of the tg_chats_archive tool.

type ChatsCreateParams

type ChatsCreateParams struct {
	Title     string   `json:"title"               jsonschema:"Title for the new chat or channel"`
	IsChannel *bool    `json:"isChannel,omitempty" jsonschema:"Create a channel instead of a group"`
	UserPeers []string `json:"userPeers,omitempty" jsonschema:"Users: @usernames or numeric IDs"`
}

ChatsCreateParams defines the parameters for the tg_chats_create tool.

type ChatsCreateResult

type ChatsCreateResult struct {
	Title  string `json:"title"`
	Type   string `json:"type"`
	Output string `json:"output"`
}

ChatsCreateResult is the output of the tg_chats_create tool.

type ChatsDeleteParams

type ChatsDeleteParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

ChatsDeleteParams defines the parameters for the tg_chats_delete tool.

type ChatsDeleteResult

type ChatsDeleteResult struct {
	Output string `json:"output"`
}

ChatsDeleteResult is the output of the tg_chats_delete tool.

type ChatsMuteParams

type ChatsMuteParams struct {
	Peer      string `json:"peer"      jsonschema:"@username, t.me/ link, or numeric ID"`
	MuteUntil int    `json:"muteUntil" jsonschema:"Unix timestamp until which to mute (0 to unmute)"`
}

ChatsMuteParams defines the parameters for the tg_chats_mute tool.

type ChatsMuteResult

type ChatsMuteResult struct {
	Peer      string `json:"peer"`
	MuteUntil int    `json:"muteUntil"`
	Output    string `json:"output"`
}

ChatsMuteResult is the output of the tg_chats_mute tool.

type ChatsPermissionsParams

type ChatsPermissionsParams struct {
	Peer         string `json:"peer"                   jsonschema:"@username, t.me/ link, or numeric ID"`
	SendMessages *bool  `json:"sendMessages,omitempty" jsonschema:"Allow sending text messages"`
	SendMedia    *bool  `json:"sendMedia,omitempty"    jsonschema:"Allow sending media (photos, videos, etc.)"`
	SendStickers *bool  `json:"sendStickers,omitempty" jsonschema:"Allow sending stickers"`
	SendGifs     *bool  `json:"sendGifs,omitempty"     jsonschema:"Allow sending GIFs"`
	SendPolls    *bool  `json:"sendPolls,omitempty"    jsonschema:"Allow sending polls"`
	AddMembers   *bool  `json:"addMembers,omitempty"   jsonschema:"Allow adding new members"`
	PinMessages  *bool  `json:"pinMessages,omitempty"  jsonschema:"Allow pinning messages"`
	ChangeInfo   *bool  `json:"changeInfo,omitempty"   jsonschema:"Allow changing chat info"`
}

ChatsPermissionsParams defines the parameters for the tg_chats_set_permissions tool.

type ChatsPermissionsResult

type ChatsPermissionsResult struct {
	Output string `json:"output"`
}

ChatsPermissionsResult is the output of the tg_chats_set_permissions tool.

type ChatsSetDescriptionParams

type ChatsSetDescriptionParams struct {
	Peer  string `json:"peer"  jsonschema:"@username, t.me/ link, or numeric ID"`
	About string `json:"about" jsonschema:"New description text for the chat"`
}

ChatsSetDescriptionParams defines the parameters for the tg_chats_set_description tool.

type ChatsSetDescriptionResult

type ChatsSetDescriptionResult struct {
	Peer   string `json:"peer"`
	About  string `json:"about"`
	Output string `json:"output"`
}

ChatsSetDescriptionResult is the output of the tg_chats_set_description tool.

type ChatsSetPhotoParams

type ChatsSetPhotoParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
	Path string `json:"path" jsonschema:"Local file path of the new photo"`
}

ChatsSetPhotoParams defines the parameters for the tg_chats_set_photo tool.

type ChatsSetPhotoResult

type ChatsSetPhotoResult struct {
	Peer   string `json:"peer"`
	Path   string `json:"path"`
	Output string `json:"output"`
}

ChatsSetPhotoResult is the output of the tg_chats_set_photo tool.

type ContactStatusItem added in v0.6.0

type ContactStatusItem struct {
	UserID   int64  `json:"userId"`
	Name     string `json:"name,omitempty"`
	Username string `json:"username,omitempty"`
	Status   string `json:"status"`
	LastSeen int    `json:"lastSeen,omitempty"`
}

ContactStatusItem is a structured contact status entry for JSON results.

Name and Username mirror the shape every other peer-bearing JSON entry uses. They stay empty today because ContactsGetStatuses (MTProto) does not return a parallel Users[] array — a follow-up can wire a batched UsersGetUsers lookup to populate them without touching the schema again.

type ContactsAddParams added in v0.6.0

type ContactsAddParams struct {
	Peer      string  `json:"peer"               jsonschema:"@username, t.me/ link, or numeric ID"`
	FirstName string  `json:"firstName"          jsonschema:"Contact first name"`
	LastName  *string `json:"lastName,omitempty" jsonschema:"Contact last name"`
	Phone     *string `json:"phone,omitempty"    jsonschema:"Contact phone number"`
}

ContactsAddParams defines parameters for tg_contacts_add.

type ContactsAddResult added in v0.6.0

type ContactsAddResult struct {
	Output string `json:"output"`
}

ContactsAddResult is the output of tg_contacts_add.

type ContactsDeleteParams added in v0.6.0

type ContactsDeleteParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

ContactsDeleteParams defines parameters for tg_contacts_delete.

type ContactsDeleteResult added in v0.6.0

type ContactsDeleteResult struct {
	Peer    string `json:"peer"`
	Deleted bool   `json:"deleted"`
	Output  string `json:"output"`
}

ContactsDeleteResult is the output of tg_contacts_delete.

type ContactsGetParams

type ContactsGetParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

ContactsGetParams defines the parameters for the tg_contacts_get tool.

type ContactsGetResult

type ContactsGetResult struct {
	UserID    int64  `json:"userId"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Username  string `json:"username"`
	Bio       string `json:"bio"`
	Output    string `json:"output"`
}

ContactsGetResult is the output of the tg_contacts_get tool.

type ContactsGetStatusesParams added in v0.6.0

type ContactsGetStatusesParams struct{}

ContactsGetStatusesParams defines parameters for tg_contacts_get_statuses.

type ContactsGetStatusesResult added in v0.6.0

type ContactsGetStatusesResult struct {
	Count    int                 `json:"count"`
	Statuses []ContactStatusItem `json:"statuses"`
	Output   string              `json:"output"`
}

ContactsGetStatusesResult is the output of tg_contacts_get_statuses.

type ContactsListBlockedParams added in v0.6.0

type ContactsListBlockedParams struct {
	Limit *int `json:"limit,omitempty" jsonschema:"Maximum results (default 100)"`
}

ContactsListBlockedParams defines parameters for tg_contacts_list_blocked.

type ContactsListBlockedResult added in v0.6.0

type ContactsListBlockedResult struct {
	Count   int        `json:"count"`
	HasMore bool       `json:"hasMore"`
	Users   []UserItem `json:"users"`
	Output  string     `json:"output"`
}

ContactsListBlockedResult is the output of tg_contacts_list_blocked.

type ContactsSearchParams

type ContactsSearchParams struct {
	Query string `json:"query"           jsonschema:"Search query for contacts"`
	Limit *int   `json:"limit,omitempty" jsonschema:"Maximum number of results (default 50)"`
}

ContactsSearchParams defines the parameters for the tg_contacts_search tool.

type ContactsSearchResult

type ContactsSearchResult struct {
	Count   int        `json:"count"`
	HasMore bool       `json:"hasMore"`
	Users   []UserItem `json:"users"`
	Output  string     `json:"output"`
}

ContactsSearchResult is the output of the tg_contacts_search tool.

type DialogItem added in v0.3.0

type DialogItem struct {
	Peer        string `json:"peer"`
	Title       string `json:"title"`
	Username    string `json:"username,omitempty"`
	Type        string `json:"type"`
	UnreadCount int    `json:"unreadCount,omitempty"`
}

DialogItem is a structured dialog entry for JSON results.

Peer is the bot-API numeric ID (signed: positive = user, negative = chat, -100xxx = channel), kept for backwards compatibility with the peer parameter every other tool accepts. Username is the @handle when the dialog is a public user/channel/supergroup — absent for private chats and basic groups. Type uses the same labels as ParticipantItem.Type / MessageItem.FromType so a consumer can pivot between the shapes uniformly.

type DialogsGetInfoParams

type DialogsGetInfoParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

DialogsGetInfoParams defines the parameters for the tg_dialogs_get_info tool.

type DialogsGetInfoResult

type DialogsGetInfoResult struct {
	Title    string `json:"title"`
	Username string `json:"username"`
	About    string `json:"about"`
	Type     string `json:"type"`
	Output   string `json:"output"`
}

DialogsGetInfoResult is the output of the tg_dialogs_get_info tool.

type DialogsListParams

type DialogsListParams struct {
	Limit      *int `json:"limit,omitempty"      jsonschema:"Maximum number of dialogs to return (default 100)"`
	OffsetDate *int `json:"offsetDate,omitempty" jsonschema:"Unix timestamp for pagination (pass last dialog date)"`
}

DialogsListParams defines the parameters for the tg_dialogs_list tool.

type DialogsListResult

type DialogsListResult struct {
	Count   int          `json:"count"`
	HasMore bool         `json:"hasMore"`
	Dialogs []DialogItem `json:"dialogs"`
	Output  string       `json:"output"`
}

DialogsListResult is the output of the tg_dialogs_list tool.

type DialogsMarkUnreadParams added in v0.6.0

type DialogsMarkUnreadParams struct {
	Peer   string `json:"peer"   jsonschema:"@username, t.me/ link, or numeric ID"`
	Unread bool   `json:"unread" jsonschema:"true to mark unread, false to mark read"`
}

DialogsMarkUnreadParams defines parameters for tg_dialogs_mark_unread.

type DialogsMarkUnreadResult added in v0.6.0

type DialogsMarkUnreadResult struct {
	Output string `json:"output"`
}

DialogsMarkUnreadResult is the output of tg_dialogs_mark_unread.

type DialogsPinParams added in v0.6.0

type DialogsPinParams struct {
	Peer   string `json:"peer"   jsonschema:"@username, t.me/ link, or numeric ID"`
	Pinned bool   `json:"pinned" jsonschema:"true to pin, false to unpin"`
}

DialogsPinParams defines parameters for tg_dialogs_pin.

type DialogsPinResult added in v0.6.0

type DialogsPinResult struct {
	Output string `json:"output"`
}

DialogsPinResult is the output of tg_dialogs_pin.

type DialogsSearchParams

type DialogsSearchParams struct {
	Query string `json:"query" jsonschema:"Search query"`
}

DialogsSearchParams defines the parameters for the tg_dialogs_search tool.

type DialogsSearchResult

type DialogsSearchResult struct {
	Count   int          `json:"count"`
	Dialogs []DialogItem `json:"dialogs"`
	Output  string       `json:"output"`
}

DialogsSearchResult is the output of the tg_dialogs_search tool.

type DraftsClearParams

type DraftsClearParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

DraftsClearParams defines the parameters for the tg_drafts_clear tool.

type DraftsClearResult

type DraftsClearResult struct {
	Peer   string `json:"peer"`
	Output string `json:"output"`
}

DraftsClearResult is the output of the tg_drafts_clear tool.

type DraftsSetParams

type DraftsSetParams struct {
	Peer    string `json:"peer"              jsonschema:"@username, t.me/ link, or numeric ID"`
	Text    string `json:"text"              jsonschema:"Draft message text"`
	ReplyTo *int   `json:"replyTo,omitempty" jsonschema:"Message ID to reply to"`
}

DraftsSetParams defines the parameters for the tg_drafts_set tool.

type DraftsSetResult

type DraftsSetResult struct {
	Peer   string `json:"peer"`
	Output string `json:"output"`
}

DraftsSetResult is the output of the tg_drafts_set tool.

type FolderItem added in v0.3.0

type FolderItem struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
	Peers int    `json:"peerCount"`
}

FolderItem is a structured folder entry for JSON results.

type FoldersCreateParams

type FoldersCreateParams struct {
	Title string   `json:"title"           jsonschema:"Title for the new folder"`
	Peers []string `json:"peers,omitempty" jsonschema:"Chats: @usernames or numeric IDs"`
}

FoldersCreateParams defines the parameters for the tg_folders_create tool.

type FoldersCreateResult

type FoldersCreateResult struct {
	FolderID int    `json:"folderId"`
	Title    string `json:"title"`
	Output   string `json:"output"`
}

FoldersCreateResult is the output of the tg_folders_create tool.

type FoldersDeleteParams

type FoldersDeleteParams struct {
	FolderID int `json:"folderId" jsonschema:"ID of the folder to delete"`
}

FoldersDeleteParams defines the parameters for the tg_folders_delete tool.

type FoldersDeleteResult

type FoldersDeleteResult struct {
	FolderID int    `json:"folderId"`
	Output   string `json:"output"`
}

FoldersDeleteResult is the output of the tg_folders_delete tool.

type FoldersEditParams

type FoldersEditParams struct {
	FolderID int      `json:"folderId"        jsonschema:"ID of the folder to edit"`
	Title    string   `json:"title"           jsonschema:"New title for the folder"`
	Peers    []string `json:"peers,omitempty" jsonschema:"Chats: @usernames or numeric IDs"`
}

FoldersEditParams defines the parameters for the tg_folders_edit tool.

type FoldersEditResult

type FoldersEditResult struct {
	FolderID int    `json:"folderId"`
	Title    string `json:"title"`
	Output   string `json:"output"`
}

FoldersEditResult is the output of the tg_folders_edit tool.

type FoldersListParams

type FoldersListParams struct{}

FoldersListParams defines the parameters for the tg_folders_list tool.

type FoldersListResult

type FoldersListResult struct {
	Count   int          `json:"count"`
	Folders []FolderItem `json:"folders"`
	Output  string       `json:"output"`
}

FoldersListResult is the output of the tg_folders_list tool.

type GroupsAdminSetParams added in v0.6.0

type GroupsAdminSetParams struct {
	Group        string  `json:"group"                    jsonschema:"@username, t.me/ link, or numeric ID"`
	User         string  `json:"user"                     jsonschema:"User ID or @username"`
	Rank         *string `json:"rank,omitempty"           jsonschema:"Admin title/rank"`
	ChangeInfo   *bool   `json:"changeInfo,omitempty"     jsonschema:"Allow changing group info"`
	PostMessages *bool   `json:"postMessages,omitempty"   jsonschema:"Allow posting in channels"`
	EditMessages *bool   `json:"editMessages,omitempty"   jsonschema:"Allow editing others messages"`
	DeleteMsgs   *bool   `json:"deleteMessages,omitempty" jsonschema:"Allow deleting messages"`
	BanUsers     *bool   `json:"banUsers,omitempty"       jsonschema:"Allow banning users"`
	InviteUsers  *bool   `json:"inviteUsers,omitempty"    jsonschema:"Allow inviting users"`
	PinMessages  *bool   `json:"pinMessages,omitempty"    jsonschema:"Allow pinning messages"`
	ManageCall   *bool   `json:"manageCall,omitempty"     jsonschema:"Allow managing calls"`
	AddAdmins    *bool   `json:"addAdmins,omitempty"      jsonschema:"Allow adding admins"`
	ManageTopics *bool   `json:"manageTopics,omitempty"   jsonschema:"Allow managing topics"`
}

GroupsAdminSetParams defines parameters for tg_groups_admin_set.

type GroupsAdminSetResult added in v0.6.0

type GroupsAdminSetResult struct {
	Output string `json:"output"`
}

GroupsAdminSetResult is the output of tg_groups_admin_set.

type GroupsInfoParams

type GroupsInfoParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

GroupsInfoParams defines the parameters for the tg_groups_info tool.

type GroupsInfoResult

type GroupsInfoResult struct {
	Title        string `json:"title"`
	Username     string `json:"username"`
	About        string `json:"about"`
	MembersCount int    `json:"membersCount"`
	IsChannel    bool   `json:"isChannel"`
	IsSupergroup bool   `json:"isSupergroup"`
	IsForum      bool   `json:"isForum"`
	Output       string `json:"output"`
}

GroupsInfoResult is the output of the tg_groups_info tool.

type GroupsInviteLinkGetParams

type GroupsInviteLinkGetParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

GroupsInviteLinkGetParams defines the parameters for the tg_groups_invite_link_get tool.

type GroupsInviteLinkGetResult

type GroupsInviteLinkGetResult struct {
	Link   string `json:"link"`
	Output string `json:"output"`
}

GroupsInviteLinkGetResult is the output of the tg_groups_invite_link_get tool.

type GroupsInviteLinkRevokeParams

type GroupsInviteLinkRevokeParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
	Link string `json:"link" jsonschema:"Invite link to revoke"`
}

GroupsInviteLinkRevokeParams defines the parameters for the tg_groups_invite_link_revoke tool.

type GroupsInviteLinkRevokeResult

type GroupsInviteLinkRevokeResult struct {
	Peer   string `json:"peer"`
	Output string `json:"output"`
}

GroupsInviteLinkRevokeResult is the output of the tg_groups_invite_link_revoke tool.

type GroupsJoinParams

type GroupsJoinParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

GroupsJoinParams defines the parameters for the tg_groups_join tool.

type GroupsJoinResult

type GroupsJoinResult struct {
	Output string `json:"output"`
}

GroupsJoinResult is the output of the tg_groups_join tool.

type GroupsLeaveParams

type GroupsLeaveParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

GroupsLeaveParams defines the parameters for the tg_groups_leave tool.

type GroupsLeaveResult

type GroupsLeaveResult struct {
	Peer    string `json:"peer"`
	Success bool   `json:"success"`
	Output  string `json:"output"`
}

GroupsLeaveResult is the output of the tg_groups_leave tool.

type GroupsListParams

type GroupsListParams struct {
	Limit *int `json:"limit,omitempty" jsonschema:"Maximum number of groups to return (default 100)"`
}

GroupsListParams defines the parameters for the tg_groups_list tool.

type GroupsListResult

type GroupsListResult struct {
	Count   int          `json:"count"`
	HasMore bool         `json:"hasMore"`
	Groups  []DialogItem `json:"groups"`
	Output  string       `json:"output"`
}

GroupsListResult is the output of the tg_groups_list tool.

type GroupsMembersAddParams

type GroupsMembersAddParams struct {
	Group string `json:"group" jsonschema:"@username, t.me/ link, or numeric ID"`
	User  string `json:"user"  jsonschema:"User ID or @username to add"`
}

GroupsMembersAddParams defines the parameters for the tg_groups_members_add tool.

type GroupsMembersAddResult

type GroupsMembersAddResult struct {
	Group  string `json:"group"`
	User   string `json:"user"`
	Output string `json:"output"`
}

GroupsMembersAddResult is the output of the tg_groups_members_add tool.

type GroupsMembersListParams added in v0.6.0

type GroupsMembersListParams struct {
	Peer   string  `json:"peer"             jsonschema:"@username, t.me/ link, or numeric ID"`
	Filter *string `json:"filter,omitempty" jsonschema:"recent, admins, banned, bots, or search query"`
	Limit  *int    `json:"limit,omitempty"  jsonschema:"Maximum results (default 100)"`
}

GroupsMembersListParams defines parameters for tg_groups_members_list.

type GroupsMembersListResult added in v0.6.0

type GroupsMembersListResult struct {
	Count   int        `json:"count"`
	HasMore bool       `json:"hasMore"`
	Users   []UserItem `json:"users"`
	Output  string     `json:"output"`
}

GroupsMembersListResult is the output of tg_groups_members_list.

type GroupsMembersRemoveParams

type GroupsMembersRemoveParams struct {
	Group string `json:"group" jsonschema:"@username, t.me/ link, or numeric ID"`
	User  string `json:"user"  jsonschema:"User ID or @username to remove"`
}

GroupsMembersRemoveParams defines the parameters for the tg_groups_members_remove tool.

type GroupsMembersRemoveResult

type GroupsMembersRemoveResult struct {
	Output string `json:"output"`
}

GroupsMembersRemoveResult is the output of the tg_groups_members_remove tool.

type GroupsRenameParams

type GroupsRenameParams struct {
	Peer  string `json:"peer"  jsonschema:"@username, t.me/ link, or numeric ID"`
	Title string `json:"title" jsonschema:"New group title"`
}

GroupsRenameParams defines the parameters for the tg_groups_rename tool.

type GroupsRenameResult

type GroupsRenameResult struct {
	Peer     string `json:"peer"`
	OldTitle string `json:"oldTitle"`
	NewTitle string `json:"newTitle"`
	Output   string `json:"output"`
}

GroupsRenameResult is the output of the tg_groups_rename tool.

type GroupsSlowmodeParams added in v0.6.0

type GroupsSlowmodeParams struct {
	Peer    string `json:"peer"    jsonschema:"@username, t.me/ link, or numeric ID"`
	Seconds int    `json:"seconds" jsonschema:"Slowmode delay in seconds (0 to disable)"`
}

GroupsSlowmodeParams defines parameters for tg_groups_slowmode.

type GroupsSlowmodeResult added in v0.6.0

type GroupsSlowmodeResult struct {
	Output string `json:"output"`
}

GroupsSlowmodeResult is the output of tg_groups_slowmode.

type MediaDownloadParams

type MediaDownloadParams struct {
	Peer      string  `json:"peer"                jsonschema:"@username, t.me/ link, or numeric ID"`
	MessageID int     `json:"messageId"           jsonschema:"Message ID containing the media"`
	OutputDir *string `json:"outputDir,omitempty" jsonschema:"Directory to save the downloaded file"`
}

MediaDownloadParams defines the parameters for the tg_media_download tool.

type MediaDownloadResult

type MediaDownloadResult struct {
	FilePath string `json:"filePath"`
	Output   string `json:"output"`
}

MediaDownloadResult is the output of the tg_media_download tool.

type MediaSendAlbumParams

type MediaSendAlbumParams struct {
	Peer         string   `json:"peer"                   jsonschema:"@username, t.me/ link, or numeric ID"`
	Paths        []string `json:"paths"                  jsonschema:"Local file paths to send as album"`
	Caption      *string  `json:"caption,omitempty"      jsonschema:"Optional caption for the album"`
	TopicID      *int     `json:"topicId,omitempty"      jsonschema:"Forum topic ID to send into"`
	ParseMode    *string  `json:"parseMode,omitempty"    jsonschema:"Caption: '' plain; 'commonmark'/'markdown' subset"`
	Silent       *bool    `json:"silent,omitempty"       jsonschema:"Send without notification sound"`
	ScheduleDate *int     `json:"scheduleDate,omitempty" jsonschema:"Unix timestamp for scheduled delivery"`
}

MediaSendAlbumParams defines the parameters for the tg_media_send_album tool.

type MediaSendAlbumResult

type MediaSendAlbumResult struct {
	Count  int    `json:"count"`
	Output string `json:"output"`
}

MediaSendAlbumResult is the output of the tg_media_send_album tool.

type MediaUploadParams

type MediaUploadParams struct {
	Path string `json:"path" jsonschema:"Local file path to upload"`
}

MediaUploadParams defines the parameters for the tg_media_upload tool.

type MediaUploadResult

type MediaUploadResult struct {
	Name   string `json:"name"`
	Size   int64  `json:"size"`
	Output string `json:"output"`
}

MediaUploadResult is the output of the tg_media_upload tool.

type MessageItem added in v0.3.0

type MessageItem struct {
	ID             int                   `json:"id"`
	PeerID         telegram.InputPeer    `json:"peerId,omitzero"`
	Date           int                   `json:"date"`
	Text           string                `json:"text"`
	FromID         int64                 `json:"fromId"`
	FromType       string                `json:"fromType,omitempty"`
	FromName       string                `json:"fromName,omitempty"`
	FromUsername   string                `json:"fromUsername,omitempty"`
	TopicID        int                   `json:"topicId,omitempty"`
	MediaType      string                `json:"mediaType,omitempty"`
	Entities       []telegram.Entity     `json:"entities,omitempty"`
	ReplyTo        *telegram.ReplyToInfo `json:"replyTo,omitempty"`
	ReplyToMessage *ReplyToMessage       `json:"replyToMessage,omitempty"`
	Forward        *telegram.ForwardInfo `json:"forward,omitempty"`
}

MessageItem is a structured message entry for JSON results.

FromType disambiguates the FromID peer kind ("user" / "group" / "channel"). The mapping mirrors MTProto's PeerClass: PeerUser → "user", PeerChat → "group" (legacy basic groups only), PeerChannel → "channel" (which covers both broadcast channels AND supergroups — gotd represents supergroups as PeerChannel). Knowing the kind lets a caller pick the right deep-link form instead of guessing — channel-on-behalf-of posts and anonymous channel posts would otherwise look indistinguishable from regular user senders. PeerID identifies the host peer (chat / channel / user) that contains the message. Carried in every MessageItem so a consumer of tg_messages_search_global — where results span arbitrary peers — can attribute each result to its source without an extra resolution call. The embedded InputPeer's AccessHash is omitted when zero (a zero hash looks valid to MTProto but raises PEER_ID_INVALID on round-trip; see the InputPeer godoc).

PeerID uses json:"peerId,omitzero" — when the upstream MTProto response carried no peer (e.g. tg.UpdateShortSentMessage from SendMessage, which only returns ID + Date), the field disappears from JSON rather than serializing a fake {type:0, id:0} that downstream code might misread as a real PeerUser ID 0. omitempty has no effect on nested structs in Go's encoding/json; omitzero (Go 1.24+) is what actually omits an all-zero InputPeer.

type MessagesClearAllDraftsParams added in v0.6.0

type MessagesClearAllDraftsParams struct{}

MessagesClearAllDraftsParams defines parameters for tg_messages_clear_all_drafts.

type MessagesClearAllDraftsResult added in v0.6.0

type MessagesClearAllDraftsResult struct {
	Cleared bool   `json:"cleared"`
	Output  string `json:"output"`
}

MessagesClearAllDraftsResult is the output of tg_messages_clear_all_drafts.

type MessagesContextParams

type MessagesContextParams struct {
	Peer           string `json:"peer"                     jsonschema:"@username, t.me/ link, or numeric ID"`
	MessageID      int    `json:"messageId"                jsonschema:"Message ID to get context around"`
	Radius         *int   `json:"radius,omitempty"         jsonschema:"Number of messages before and after (default 10)"`
	ResolveReplies *bool  `json:"resolveReplies,omitempty" jsonschema:"Fetch parent message text for replies (default false, extra API call)"`
}

MessagesContextParams defines the parameters for the tg_messages_context tool.

type MessagesContextResult

type MessagesContextResult struct {
	Count        int               `json:"count"`
	Participants []ParticipantItem `json:"participants,omitempty"`
	Messages     []MessageItem     `json:"messages"`
	Output       string            `json:"output"`
}

MessagesContextResult is the output of the tg_messages_context tool.

type MessagesDeleteHistoryParams added in v0.6.0

type MessagesDeleteHistoryParams struct {
	Peer   string `json:"peer"             jsonschema:"@username, t.me/ link, or numeric ID"`
	Revoke *bool  `json:"revoke,omitempty" jsonschema:"Delete for both sides (default false)"`
}

MessagesDeleteHistoryParams defines parameters for tg_messages_delete_history.

type MessagesDeleteHistoryResult added in v0.6.0

type MessagesDeleteHistoryResult struct {
	Output string `json:"output"`
}

MessagesDeleteHistoryResult is the output of tg_messages_delete_history.

type MessagesDeleteParams

type MessagesDeleteParams struct {
	Peer   string `json:"peer"             jsonschema:"@username, t.me/ link, or numeric ID"`
	IDs    []int  `json:"ids"              jsonschema:"Message IDs to delete"`
	Revoke *bool  `json:"revoke,omitempty" jsonschema:"Delete for everyone (default true)"`
}

MessagesDeleteParams defines the parameters for the tg_messages_delete tool.

type MessagesDeleteResult

type MessagesDeleteResult struct {
	Deleted int    `json:"deleted"`
	Output  string `json:"output"`
}

MessagesDeleteResult is the output of the tg_messages_delete tool.

type MessagesEditParams

type MessagesEditParams struct {
	Peer      string  `json:"peer"                jsonschema:"@username, t.me/ link, or numeric ID"`
	MessageID int     `json:"messageId"           jsonschema:"ID of the message to edit"`
	Text      string  `json:"text"                jsonschema:"New message text"`
	ParseMode *string `json:"parseMode,omitempty" jsonschema:"'' plain; 'commonmark' (CommonMark subset, see README); 'markdown' alias"`
}

MessagesEditParams defines the parameters for the tg_messages_edit tool.

type MessagesEditResult

type MessagesEditResult struct {
	MessageID int    `json:"messageId"`
	Output    string `json:"output"`
}

MessagesEditResult is the output of the tg_messages_edit tool.

type MessagesForwardParams

type MessagesForwardParams struct {
	FromPeer string `json:"fromPeer" jsonschema:"Source: @username, t.me/ link, or numeric ID"`
	ToPeer   string `json:"toPeer"   jsonschema:"Destination: @username, t.me/ link, or numeric ID"`
	IDs      []int  `json:"ids"      jsonschema:"Message IDs to forward"`
}

MessagesForwardParams defines the parameters for the tg_messages_forward tool.

type MessagesForwardResult

type MessagesForwardResult struct {
	Forwarded int           `json:"forwarded"`
	Messages  []MessageItem `json:"messages"`
	Output    string        `json:"output"`
}

MessagesForwardResult is the output of the tg_messages_forward tool.

type MessagesGetParams

type MessagesGetParams struct {
	Peer           string `json:"peer"                     jsonschema:"@username, t.me/ link, or numeric ID"`
	IDs            []int  `json:"ids"                      jsonschema:"Message IDs to retrieve"`
	ResolveReplies *bool  `json:"resolveReplies,omitempty" jsonschema:"Fetch parent message text for replies (default false, extra API call)"`
}

MessagesGetParams defines the parameters for the tg_messages_get tool.

type MessagesGetReactionsParams added in v0.6.0

type MessagesGetReactionsParams struct {
	Peer      string `json:"peer"            jsonschema:"@username, t.me/ link, or numeric ID"`
	MessageID int    `json:"messageId"       jsonschema:"Message ID to get reactions for"`
	Limit     *int   `json:"limit,omitempty" jsonschema:"Maximum results (default 100)"`
}

MessagesGetReactionsParams defines parameters for tg_messages_get_reactions.

type MessagesGetReactionsResult added in v0.6.0

type MessagesGetReactionsResult struct {
	Count     int                `json:"count"`
	HasMore   bool               `json:"hasMore"`
	Reactions []ReactionUserItem `json:"reactions"`
	Output    string             `json:"output"`
}

MessagesGetReactionsResult is the output of tg_messages_get_reactions.

type MessagesGetResult

type MessagesGetResult struct {
	Count        int               `json:"count"`
	Participants []ParticipantItem `json:"participants,omitempty"`
	Messages     []MessageItem     `json:"messages"`
	Output       string            `json:"output"`
}

MessagesGetResult is the output of the tg_messages_get tool.

type MessagesGetScheduledParams added in v0.6.0

type MessagesGetScheduledParams struct {
	Peer string `json:"peer" jsonschema:"@username, t.me/ link, or numeric ID"`
}

MessagesGetScheduledParams defines parameters for tg_messages_get_scheduled.

type MessagesGetScheduledResult added in v0.6.0

type MessagesGetScheduledResult struct {
	Count    int           `json:"count"`
	Messages []MessageItem `json:"messages"`
	Output   string        `json:"output"`
}

MessagesGetScheduledResult is the output of tg_messages_get_scheduled.

type MessagesListParams

type MessagesListParams struct {
	Peer           string `json:"peer"                     jsonschema:"@username, t.me/ link, or numeric ID"`
	TopicID        *int   `json:"topicId,omitempty"        jsonschema:"Forum topic ID to filter messages"`
	Limit          *int   `json:"limit,omitempty"          jsonschema:"Max messages to return (default 100)"`
	OffsetID       *int   `json:"offsetId,omitempty"       jsonschema:"Message ID to start from"`
	ResolveReplies *bool  `json:"resolveReplies,omitempty" jsonschema:"Fetch parent message text for replies (default false, extra API call)"`
}

MessagesListParams defines the parameters for the tg_messages_list tool.

type MessagesListResult

type MessagesListResult struct {
	Count        int               `json:"count"`
	Total        int               `json:"total"`
	HasMore      bool              `json:"hasMore"`
	Participants []ParticipantItem `json:"participants,omitempty"`
	Messages     []MessageItem     `json:"messages"`
	Output       string            `json:"output"`
}

MessagesListResult is the output of the tg_messages_list tool.

type MessagesMarkReadParams

type MessagesMarkReadParams struct {
	Peer  string `json:"peer"  jsonschema:"@username, t.me/ link, or numeric ID"`
	MaxID int    `json:"maxId" jsonschema:"Mark all messages up to this ID as read"`
}

MessagesMarkReadParams defines the parameters for the tg_messages_mark_read tool.

type MessagesMarkReadResult

type MessagesMarkReadResult struct {
	Output string `json:"output"`
}

MessagesMarkReadResult is the output of the tg_messages_mark_read tool.

type MessagesPinParams

type MessagesPinParams struct {
	Peer      string `json:"peer"            jsonschema:"@username, t.me/ link, or numeric ID"`
	MessageID int    `json:"messageId"       jsonschema:"ID of the message to pin/unpin"`
	Unpin     *bool  `json:"unpin,omitempty" jsonschema:"Set to true to unpin instead of pin"`
}

MessagesPinParams defines the parameters for the tg_messages_pin tool.

type MessagesPinResult

type MessagesPinResult struct {
	Output string `json:"output"`
}

MessagesPinResult is the output of the tg_messages_pin tool.

type MessagesReactParams

type MessagesReactParams struct {
	Peer      string `json:"peer"             jsonschema:"@username, t.me/ link, or numeric ID"`
	MessageID int    `json:"messageId"        jsonschema:"ID of the message to react to"`
	Emoji     string `json:"emoji"            jsonschema:"Reaction emoji (e.g. 👍)"`
	Remove    *bool  `json:"remove,omitempty" jsonschema:"Remove reaction instead of adding"`
}

MessagesReactParams defines the parameters for the tg_messages_react tool.

type MessagesReactResult

type MessagesReactResult struct {
	Output string `json:"output"`
}

MessagesReactResult is the output of the tg_messages_react tool.

type MessagesSearchGlobalParams added in v0.6.0

type MessagesSearchGlobalParams struct {
	Query string `json:"query"           jsonschema:"Search query"`
	Limit *int   `json:"limit,omitempty" jsonschema:"Maximum results (default 100)"`
}

MessagesSearchGlobalParams defines parameters for tg_messages_search_global.

Note: resolveReplies is intentionally not offered here. Global search returns messages from arbitrary peers, each needing its own access hash to fetch the parent; a single batched lookup is not possible. Structural replyTo metadata is still populated.

type MessagesSearchGlobalResult added in v0.6.0

type MessagesSearchGlobalResult struct {
	Count    int           `json:"count"`
	HasMore  bool          `json:"hasMore"`
	Messages []MessageItem `json:"messages"`
	Output   string        `json:"output"`
}

MessagesSearchGlobalResult is the output of tg_messages_search_global.

type MessagesSearchParams

type MessagesSearchParams struct {
	Peer           string `json:"peer"                     jsonschema:"@username, t.me/ link, or numeric ID"`
	Query          string `json:"query"                    jsonschema:"Search query"`
	Limit          *int   `json:"limit,omitempty"          jsonschema:"Max results (default 100)"`
	OffsetID       *int   `json:"offsetId,omitempty"       jsonschema:"Message ID to start search from (for pagination)"`
	ResolveReplies *bool  `json:"resolveReplies,omitempty" jsonschema:"Fetch parent message text for replies (default false, extra API call)"`
}

MessagesSearchParams defines the parameters for the tg_messages_search tool.

type MessagesSearchResult

type MessagesSearchResult struct {
	Count        int               `json:"count"`
	HasMore      bool              `json:"hasMore"`
	Participants []ParticipantItem `json:"participants,omitempty"`
	Messages     []MessageItem     `json:"messages"`
	Output       string            `json:"output"`
}

MessagesSearchResult is the output of the tg_messages_search tool.

type MessagesSendFileParams

type MessagesSendFileParams struct {
	Peer         string  `json:"peer"                   jsonschema:"@username, t.me/ link, or numeric ID"`
	Path         string  `json:"path"                   jsonschema:"Local file path to send"`
	Caption      *string `json:"caption,omitempty"      jsonschema:"Optional caption for the file"`
	TopicID      *int    `json:"topicId,omitempty"      jsonschema:"Forum topic ID to send into"`
	ParseMode    *string `json:"parseMode,omitempty"    jsonschema:"Caption format: '' plain; 'commonmark'/'markdown' (subset, see README)"`
	Silent       *bool   `json:"silent,omitempty"       jsonschema:"Send without notification sound"`
	ScheduleDate *int    `json:"scheduleDate,omitempty" jsonschema:"Unix timestamp for scheduled delivery"`
}

MessagesSendFileParams defines the parameters for the tg_messages_send_file tool.

type MessagesSendFileResult

type MessagesSendFileResult struct {
	MessageID int    `json:"messageId"`
	Output    string `json:"output"`
}

MessagesSendFileResult is the output of the tg_messages_send_file tool.

type MessagesSendParams

type MessagesSendParams struct {
	Peer         string  `json:"peer"                   jsonschema:"@username, t.me/ link, or numeric ID"`
	Text         string  `json:"text"                   jsonschema:"Message text to send"`
	TopicID      *int    `json:"topicId,omitempty"      jsonschema:"Forum topic ID to send into"`
	ReplyTo      *int    `json:"replyTo,omitempty"      jsonschema:"Message ID to reply to"`
	ParseMode    *string `json:"parseMode,omitempty"    jsonschema:"'' plain; 'commonmark' (CommonMark subset, see README); 'markdown' alias"`
	Silent       *bool   `json:"silent,omitempty"       jsonschema:"Send without notification sound"`
	NoWebpage    *bool   `json:"noWebpage,omitempty"    jsonschema:"Disable link preview generation"`
	ScheduleDate *int    `json:"scheduleDate,omitempty" jsonschema:"Unix timestamp to schedule message for later delivery"`
}

MessagesSendParams defines the parameters for the tg_messages_send tool.

type MessagesSendResult

type MessagesSendResult struct {
	MessageID int    `json:"messageId"`
	Output    string `json:"output"`
}

MessagesSendResult is the output of the tg_messages_send tool.

type OnlineStatusSetParams

type OnlineStatusSetParams struct {
	Online bool `json:"online" jsonschema:"True to appear online, false to go offline"`
}

OnlineStatusSetParams defines the parameters for the tg_online_status_set tool.

type OnlineStatusSetResult

type OnlineStatusSetResult struct {
	Online bool   `json:"online"`
	Output string `json:"output"`
}

OnlineStatusSetResult is the output of the tg_online_status_set tool.

type ParticipantItem added in v0.5.0

type ParticipantItem struct {
	ID       int64  `json:"id"`
	Type     string `json:"type"`
	Name     string `json:"name"`
	Username string `json:"username,omitempty"`
}

ParticipantItem identifies every peer that appears as a sender or as the original author of a forwarded message in a returned batch.

Type follows the same mapping as MessageItem.FromType ("user" / "group" / "channel"; "channel" covers both broadcast channels and supergroups, "group" is only legacy basic groups). The Type field also disambiguates the ID space — without it a user with ID N and a channel with ID N would collide in the seen-set and silently merge into one entry.

type PeerRefItem added in v0.13.0

type PeerRefItem = ParticipantItem

PeerRefItem is the canonical {id, type, name, username} shape used for every peer JSON-rendered across the tool surface — sender, forward-author, participant, dialog, channel/group reference, reactor, contact. Tools that historically used ad-hoc shapes (DialogItem, UserItem, ReactionUserItem, etc.) are converging on this struct so a consumer can treat any peer uniformly.

type PhotoItem added in v0.3.0

type PhotoItem struct {
	ID   int64 `json:"id"`
	Date int   `json:"date"`
}

PhotoItem is a structured photo entry for JSON results.

type ProfileGetParams

type ProfileGetParams struct{}

ProfileGetParams defines the parameters for the tg_profile_get tool.

type ProfileGetResult

type ProfileGetResult struct {
	UserID    int64  `json:"userId"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Username  string `json:"username"`
	Phone     string `json:"phone"`
	Bio       string `json:"bio"`
	Output    string `json:"output"`
}

ProfileGetResult is the output of the tg_profile_get tool.

type ProfileSetBioParams

type ProfileSetBioParams struct {
	Bio string `json:"bio" jsonschema:"New bio text (max 70 characters)"`
}

ProfileSetBioParams defines the parameters for the tg_profile_set_bio tool.

type ProfileSetBioResult

type ProfileSetBioResult struct {
	Bio    string `json:"bio"`
	Output string `json:"output"`
}

ProfileSetBioResult is the output of the tg_profile_set_bio tool.

type ProfileSetNameParams

type ProfileSetNameParams struct {
	FirstName string `json:"firstName" jsonschema:"New first name"`
	LastName  string `json:"lastName"  jsonschema:"New last name"`
}

ProfileSetNameParams defines the parameters for the tg_profile_set_name tool.

type ProfileSetNameResult

type ProfileSetNameResult struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Output    string `json:"output"`
}

ProfileSetNameResult is the output of the tg_profile_set_name tool.

type ProfileSetPhotoParams

type ProfileSetPhotoParams struct {
	Path string `json:"path" jsonschema:"Local file path of the new profile photo"`
}

ProfileSetPhotoParams defines the parameters for the tg_profile_set_photo tool.

type ProfileSetPhotoResult

type ProfileSetPhotoResult struct {
	Output string `json:"output"`
}

ProfileSetPhotoResult is the output of the tg_profile_set_photo tool.

type ReactionUserItem added in v0.6.0

type ReactionUserItem struct {
	UserID   int64  `json:"userId"`
	Name     string `json:"name,omitempty"`
	Username string `json:"username,omitempty"`
	Emoji    string `json:"emoji"`
}

ReactionUserItem is a structured reaction entry for JSON results.

Name and Username mirror the shape used by every other peer-bearing JSON entry (sender, forward-author, participant) so a consumer can render a reactor with the same "Display Name [@username]" identifier.

type ReplyToMessage added in v0.8.0

type ReplyToMessage struct {
	FromName     string `json:"fromName,omitempty"`
	FromUsername string `json:"fromUsername,omitempty"`
	Text         string `json:"text,omitempty"`
}

ReplyToMessage carries minimal parent-message context used to help callers reconstruct thread structure when the parent is outside the returned batch.

type ServerVersionParams added in v0.11.0

type ServerVersionParams struct{}

ServerVersionParams takes no arguments — version metadata is fixed at build time and supplied by the handler factory.

type ServerVersionResult added in v0.11.0

type ServerVersionResult struct {
	Version   string `json:"version"`
	Revision  string `json:"revision"`
	GoVersion string `json:"goVersion"`
	Output    string `json:"output"`
}

ServerVersionResult is the output of the tg_server_version tool.

type StickerSetItem added in v0.3.0

type StickerSetItem struct {
	Name  string `json:"name"`
	Title string `json:"title"`
	Count int    `json:"count"`
}

StickerSetItem is a structured sticker set entry for JSON results.

type StickersGetSetParams

type StickersGetSetParams struct {
	Name string `json:"name" jsonschema:"Short name of the sticker set"`
}

StickersGetSetParams defines the parameters for the tg_stickers_get_set tool.

type StickersGetSetResult

type StickersGetSetResult struct {
	Title  string `json:"title"`
	Count  int    `json:"count"`
	Output string `json:"output"`
}

StickersGetSetResult is the output of the tg_stickers_get_set tool.

type StickersSearchParams

type StickersSearchParams struct {
	Query string `json:"query" jsonschema:"Search query for sticker sets"`
}

StickersSearchParams defines the parameters for the tg_stickers_search tool.

type StickersSearchResult

type StickersSearchResult struct {
	Count  int              `json:"count"`
	Sets   []StickerSetItem `json:"sets"`
	Output string           `json:"output"`
}

StickersSearchResult is the output of the tg_stickers_search tool.

type StickersSendParams

type StickersSendParams struct {
	Peer          string `json:"peer"          jsonschema:"@username, t.me/ link, or numeric ID"`
	StickerFileID int64  `json:"stickerFileId" jsonschema:"File ID of the sticker to send"`
}

StickersSendParams defines the parameters for the tg_stickers_send tool.

type StickersSendResult

type StickersSendResult struct {
	MessageID int    `json:"messageId"`
	Output    string `json:"output"`
}

StickersSendResult is the output of the tg_stickers_send tool.

type TopicItem added in v0.3.0

type TopicItem struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
	Date  int    `json:"date"`
}

TopicItem is a structured forum topic entry for JSON results.

type TopicsCreateParams added in v0.6.0

type TopicsCreateParams struct {
	Peer  string `json:"peer"  jsonschema:"@username, t.me/ link, or numeric ID"`
	Title string `json:"title" jsonschema:"Topic title"`
}

TopicsCreateParams defines parameters for tg_topics_create.

type TopicsCreateResult added in v0.6.0

type TopicsCreateResult struct {
	TopicID int    `json:"topicId"`
	Title   string `json:"title"`
	Output  string `json:"output"`
}

TopicsCreateResult is the output of tg_topics_create.

type TopicsEditParams added in v0.6.0

type TopicsEditParams struct {
	Peer    string `json:"peer"    jsonschema:"@username, t.me/ link, or numeric ID"`
	TopicID int    `json:"topicId" jsonschema:"Topic ID to edit"`
	Title   string `json:"title"   jsonschema:"New topic title"`
}

TopicsEditParams defines parameters for tg_topics_edit.

type TopicsEditResult added in v0.6.0

type TopicsEditResult struct {
	Output string `json:"output"`
}

TopicsEditResult is the output of tg_topics_edit.

type TopicsListParams

type TopicsListParams struct {
	Peer  string  `json:"peer"            jsonschema:"Forum supergroup ID or @username"`
	Limit *int    `json:"limit,omitempty" jsonschema:"Maximum number of topics to return"`
	Query *string `json:"query,omitempty" jsonschema:"Optional text to filter topics by title"`
}

TopicsListParams defines the parameters for the tg_topics_list tool.

type TopicsListResult

type TopicsListResult struct {
	Count   int         `json:"count"`
	HasMore bool        `json:"hasMore"`
	Topics  []TopicItem `json:"topics"`
	Output  string      `json:"output"`
}

TopicsListResult is the output of the tg_topics_list tool.

type TopicsSearchParams

type TopicsSearchParams struct {
	Peer  string `json:"peer"  jsonschema:"Forum supergroup ID or @username"`
	Query string `json:"query" jsonschema:"Search query to filter topics by title"`
}

TopicsSearchParams defines the parameters for the tg_topics_search tool.

type TopicsSearchResult

type TopicsSearchResult struct {
	Count  int         `json:"count"`
	Topics []TopicItem `json:"topics"`
	Output string      `json:"output"`
}

TopicsSearchResult is the output of the tg_topics_search tool.

type TypingSendParams

type TypingSendParams struct {
	Peer   string  `json:"peer"             jsonschema:"@username, t.me/ link, or numeric ID"`
	Action *string `json:"action,omitempty" jsonschema:"Typing action type (default typing)"`
}

TypingSendParams defines the parameters for the tg_typing_send tool.

type TypingSendResult

type TypingSendResult struct {
	Output string `json:"output"`
}

TypingSendResult is the output of the tg_typing_send tool.

type UserItem added in v0.3.0

type UserItem struct {
	ID        int64  `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName,omitempty"`
	Username  string `json:"username,omitempty"`
}

UserItem is a structured user entry for JSON results.

type UsersBlockParams

type UsersBlockParams struct {
	Peer  string `json:"peer"  jsonschema:"User ID or @username"`
	Block bool   `json:"block" jsonschema:"True to block, false to unblock"`
}

UsersBlockParams defines the parameters for the tg_users_block tool.

type UsersBlockResult

type UsersBlockResult struct {
	Output string `json:"output"`
}

UsersBlockResult is the output of the tg_users_block tool.

type UsersCommonChatsParams

type UsersCommonChatsParams struct {
	Peer string `json:"peer" jsonschema:"User ID or @username"`
}

UsersCommonChatsParams defines the parameters for the tg_users_get_common_chats tool.

type UsersCommonChatsResult

type UsersCommonChatsResult struct {
	Count  int           `json:"count"`
	Chats  []PeerRefItem `json:"chats"`
	Output string        `json:"output"`
}

UsersCommonChatsResult is the output of the tg_users_get_common_chats tool.

Chats carries one PeerRefItem per shared chat with {id, type, name, username}, same shape every other peer-listing tool exposes, so a caller doesn't need to regex-parse Output.

type UsersGetParams

type UsersGetParams struct {
	Peer string `json:"peer" jsonschema:"@username (preferred) or numeric user ID"`
}

UsersGetParams defines the parameters for the tg_users_get tool.

type UsersGetResult

type UsersGetResult struct {
	UserID    int64  `json:"userId"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Username  string `json:"username"`
	Bot       bool   `json:"bot"`
	Bio       string `json:"bio"`
	Online    bool   `json:"online"`
	Output    string `json:"output"`
}

UsersGetResult is the output of the tg_users_get tool.

type UsersPhotosParams

type UsersPhotosParams struct {
	Peer  string `json:"peer"            jsonschema:"User ID or @username"`
	Limit *int   `json:"limit,omitempty" jsonschema:"Maximum number of photos to return (default 10)"`
}

UsersPhotosParams defines the parameters for the tg_users_get_photos tool.

type UsersPhotosResult

type UsersPhotosResult struct {
	Count   int         `json:"count"`
	HasMore bool        `json:"hasMore"`
	Photos  []PhotoItem `json:"photos"`
	Output  string      `json:"output"`
}

UsersPhotosResult is the output of the tg_users_get_photos tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL