Bale Bot

v0.3.2
io.github.sepehr071/bale-mcp Checked 4 days ago Published 18 days ago

Private, local Bale bot for agents: read, search and answer messages, ask and wait, files.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

bot_get_me Bot: who am I

Check BALE_BOT_TOKEN and show the bot's id, username and name.

bot_get_chat Bot: chat info

Get a chat's type, title or name, username and description.

ParameterTypeDescription
chat_id *Chat id (number) or public '@channel' username.

bot_get_webhook_info Bot: webhook status

Show whether a webhook is set (url empty = the reading tools work), pending updates and the last error.

bot_send_message Bot: send message

Send a real text message from the bot. Confirm recipient and text with the user first. Markdown text. The user must have sent /start first. Then bot_wait_for_reply with the returned message_id.

ParameterTypeDescription
chat_id *Chat id (number) or public '@channel' username.
text *stringMessage text.
buttonsInline buttons as rows of labels, e.g. [['Yes', 'No']]. A press arrives as kind 'button'.
reply_to_message_idMessage id to reply to.

bot_send_file Bot: send file

Send a real photo, document, video, audio or voice file from the bot. Confirm recipient and file with the user first.

ParameterTypeDescription
chat_id *Chat id (number) or public '@channel' username.
kind *stringFile type.
source *stringhttp(s) URL, or local path inside BALE_MCP_SEND_DIRS (max 50 MB).
captionCaption.

bot_edit_message Bot: edit message

Replace the text of a message the bot sent earlier. Changes a real message; confirm with the user first.

ParameterTypeDescription
chat_id *Chat id (number) or public '@channel' username.
message_id *integerId of a bot text message.
text *stringNew text.

bot_delete_message Bot: delete message

Delete a message the bot may delete (its own, or as admin). Irreversible; confirm with the user first.

ParameterTypeDescription
chat_id *Chat id (number) or public '@channel' username.
message_id *integerMessage id to delete.

bot_get_new_messages Bot: new messages

Get messages people sent the bot since the last check, from all chats, oldest first, and mark them read. Messages carry chat_id, kind, text and file_id for media. Fails while a webhook is set.

ParameterTypeDescription
limitintegerMax messages.

bot_list_chats Bot: list chats

List the chats this bot has talked in, newest first, with unread count and last message.

ParameterTypeDescription
limitintegerMax chats.

bot_read_chat Bot: read chat

Show a chat's recent messages in both directions, oldest first, and mark the chat read (local store; Bale keeps no history).

ParameterTypeDescription
chat_id *integerNumeric chat id.
limitintegerMax messages.

bot_search_messages Bot: search messages

Search stored messages by text, newest first. Persian/Arabic yeh, kaf, digits and ZWNJ match each other. Long texts are cut; bot_read_chat shows them whole.

ParameterTypeDescription
query *stringText to find.
chat_idOnly this chat.
limitintegerMax messages.
max_charsintegerCut each text to this length.

bot_wait_for_reply Bot: wait for reply

Wait until someone writes in a chat or presses a button, then return the new messages (marked read). Use after bot_send_message. Returns timed_out=true if nobody answered.

ParameterTypeDescription
chat_id *integerNumeric chat id.
after_message_idOnly messages newer than this id (the message_id you sent).
timeout_secondsintegerSeconds to wait.

bot_download_file Bot: download file

Download a file someone sent the bot (max 20 MB) and return its local path. Never overwrites (-1, -2, ... suffix).

ParameterTypeDescription
file_id *stringfile_id from a received message.
folderSave folder (default ~/.bale-mcp/files).