>cogtrix v0.3.0

Messaging

WhatsApp Messaging

Send and receive WhatsApp messages via a self-hosted Waha container. All four tools are automatically hidden when WhatsApp is not configured.

Requires: A running Waha Docker container. See WhatsApp Setup for configuration.

whatsapp_send

Send a text message via WhatsApp.

Requires Confirmation: Yes (configurable)

Parameters:

ParameterTypeRequiredDescription
tostringYesRecipient — phone number in E.164 format (e.g. +14155551234) or a phonebook nickname (e.g. alice)
messagestringYesText message body (max 4096 chars)

Returns: Confirmation with message ID, or error/block reason

Example:

whatsapp_send(to="alice", message="Meeting moved to 3pm")

whatsapp_send_image

Send an image via WhatsApp given a public URL.

Requires Confirmation: Yes (configurable)

Parameters:

ParameterTypeRequiredDescription
tostringYesRecipient — phone number or phonebook nickname
image_urlstringYesPublic URL of the image (JPEG preferred)
captionstringNoOptional caption text

Returns: Confirmation with message ID, or error/block reason


whatsapp_check

Retrieve recent WhatsApp messages. Optionally filter by a specific contact.

Parameters:

ParameterTypeRequiredDefaultDescription
contactstringNoAll chatsPhone number or phonebook nickname to filter by
limitintNo10Number of recent messages (max 50)

Returns: Formatted list of recent messages with sender, timestamp, and body


whatsapp_contacts

List the configured phonebook contacts and active filter rules.

Parameters: None

Returns: Phonebook listing with nicknames, phone numbers, and filter mode


Contact Filtering

WhatsApp tools enforce contact restrictions before any message is sent or received:

Filter ModeBehavior
none (default)All contacts allowed
allowOnly contacts in the list can send/receive (legacy value whitelist is auto-mapped to allow)
ignoreSkip listed contacts — no response sent, message kept on the platform
blacklistContacts in the list are blocked (message deleted, chat archived)

Phonebook nicknames (e.g. "alice") are resolved to E.164 numbers automatically and are case-insensitive.

Rate Limiting

Outbound messages are rate-limited to prevent abuse. Default: 30 messages/hour (configurable, 0 = unlimited). The limit uses an in-memory sliding window that resets on process restart.


Telegram Messaging

Send and receive Telegram messages via a bot created with @BotFather. All four tools are automatically hidden when the bot token is not configured.

Requires: A bot token (COGTRIX_TELEGRAM_TOKEN environment variable or services.telegram.bot_token in config). See Telegram Setup for configuration.

telegram_send

Send a text message via Telegram.

Requires Confirmation: Yes (configurable)

Parameters:

ParameterTypeRequiredDescription
tostringYesRecipient — a chat ID (numeric), @username, or a phonebook nickname (e.g. alice)
messagestringYesText message body (max 4096 chars)

Returns: Confirmation with message ID, or error/block reason

Example:

telegram_send(to="alice", message="Meeting moved to 3pm")

telegram_send_photo

Send a photo via Telegram given a public URL.

Requires Confirmation: Yes (configurable)

Parameters:

ParameterTypeRequiredDescription
tostringYesRecipient — a chat ID, @username, or phonebook nickname
photo_urlstringYesPublic URL of the photo
captionstringNoOptional caption text

Returns: Confirmation with message ID, or error/block reason


telegram_check

Retrieve recent Telegram messages sent to the bot.

Parameters:

ParameterTypeRequiredDefaultDescription
limitintNo10Number of recent messages (max 50)

Returns: Formatted list of recent messages with sender, timestamp, chat, and body


telegram_contacts

List the configured phonebook contacts and active filter rules.

Parameters: None

Returns: Phonebook listing with nicknames, chat IDs, and filter mode


Contact Filtering

Telegram tools enforce contact restrictions before any message is sent or received:

Filter ModeBehavior
none (default)All contacts allowed
allowOnly contacts in the list can send/receive (legacy value whitelist is auto-mapped to allow)
ignoreSkip listed contacts — no response sent, message kept on the platform
blacklistContacts in the list are blocked (message deleted)

Phonebook nicknames are resolved to chat IDs automatically and are case-insensitive.

Rate Limiting

Outbound messages are rate-limited to prevent abuse. Default: 30 messages/hour (configurable, 0 = unlimited). The limit uses an in-memory sliding window that resets on process restart.


Email Tools

read_email

Read emails from an IMAP mailbox.

Configuration: Requires services.email.imap_host, services.email.username, and services.email.password in .cogtrix.yml.

Parameters:

ParameterTypeRequiredDescription
folderstringNoMailbox folder (default: INBOX)
limitintNoMaximum messages to return (default: 10)
unread_onlyboolNoReturn only unread messages (default: false)
senderstringNoFilter by sender email address
subject_containsstringNoFilter by subject keyword

Returns: List of emails with sender, subject, date, and body preview.


send_email

Send an email via SMTP.

Parameters:

ParameterTypeRequiredDescription
tostringYesRecipient email address
subjectstringYesEmail subject line
bodystringYesEmail body text
ccstringNoCC recipient(s), comma-separated
bccstringNoBCC recipient(s), comma-separated
fromstringNoSender address (default: configured default)

Returns: Confirmation with message ID on success, or error on failure.


search_email

Search emails by content across the mailbox.

Parameters:

ParameterTypeRequiredDescription
querystringYesSearch query (matches subject, body, sender)
folderstringNoMailbox folder to search (default: INBOX)
limitintNoMaximum results (default: 20)
date_afterstringNoFilter messages after this date (ISO 8601)
date_beforestringNoFilter messages before this date (ISO 8601)

Returns: Matching emails with sender, subject, date, and relevance snippet.


Slack Messaging

cogtrix_slack_post_message

Post a message to a Slack channel with automatic markdown-to-mrkdwn conversion. Supports bold, tables, and headings.

Configuration: Requires services.slack.bot_token in .cogtrix.yml.

Parameters:

ParameterTypeRequiredDescription
channelstringYesSlack channel ID (e.g., C0123456789)
textstringYesMessage text (supports markdown)
blocksarrayNoOptional block structure for rich messaging

Example:

cogtrix_slack_post_message(
    channel="C0123456789",
    text="**Task Complete!**\n\nThe analysis is ready. See details in the report."
)

Returns: Message timestamp and success status