Skip to main content

matimo-slack

Slack tools for Matimo - send messages, manage channels, upload files, and more.

PyPI Docs


Installation

pip install matimo matimo-slack

Available Tools (16 Total)

Category Tool Description
Messaging slack_send_channel_message Post message with markdown/blocks
slack-send-message Post plain message to channel
slack_reply_to_message Reply in thread
slack_send_dm Send direct message
Channels slack-list-channels List all channels/DMs
slack_create_channel Create public/private channel
slack_join_channel Add bot to channel
slack_set_channel_topic Update channel description/topic
Files slack_upload_file Request an upload URL for a file (modern API, step 1 of 2 - see note below)
Reading slack_get_channel_history Read messages from channel
slack_get_thread_replies Get thread replies
slack_search_messages Search message history
Reactions slack_add_reaction Add emoji reaction to message
slack_get_reactions Get reactions on a message
Users slack_get_user_info Get user profile details
slack-get-user Alias of slack_get_user_info

⚠️ slack_upload_file only performs step 1 of Slack's modern upload flow (files.getUploadURLExternal) - it returns an upload_url you must PUT the file binary to yourself, then call Slack's files.completeUploadExternal directly. Matimo does not ship tools for those remaining two steps.


Quick Start

import asyncio
import os
from matimo import Matimo
from matimo_slack import get_tools_path

async def main():
    matimo = await Matimo.init(get_tools_path())

    # Send a message
    await matimo.execute('slack_send_channel_message', {
        'channel': '#general',
        'text': 'Hello from Matimo!',
    })

    # List channels
    result = await matimo.execute('slack-list-channels', {})
    print(result)

asyncio.run(main())

Authentication

All tools authenticate using a Slack Bot Token:

export SLACK_BOT_TOKEN="xoxb-your-bot-token"

Setting Up a Slack App

  1. Go to api.slack.com/apps → Create New App → From scratch
  2. Navigate to OAuth & Permissions and add scopes (see table below)
  3. Click Install to Workspace and copy the Bot User OAuth Token
  4. Set SLACK_BOT_TOKEN in your environment

Required OAuth Scopes

Tool Slack API Method Required Scopes
slack_send_channel_message / slack-send-message chat.postMessage chat:write
slack_reply_to_message chat.postMessage chat:write
slack_send_dm conversations.open + chat.postMessage im:write, mpim:write
slack-list-channels conversations.list channels:read, groups:read, im:read, mpim:read
slack_create_channel conversations.create channels:manage, channels:write, groups:write
slack_join_channel conversations.join channels:manage
slack_set_channel_topic conversations.setTopic conversations:manage
slack_upload_file files.getUploadURLExternal files:write
slack_get_channel_history conversations.history conversations:history
slack_get_thread_replies conversations.replies conversations:history
slack_search_messages search.messages search:read
slack_add_reaction reactions.add reactions:write
slack_get_reactions reactions.get reactions:read
slack_get_user_info / slack-get-user users.info users:read

LangChain Agent Example

from matimo import Matimo
from matimo_slack import get_tools_path
from matimo.integrations.langchain import convert_tools_to_langchain
from langchain_openai import ChatOpenAI
from langchain.agents import AgentExecutor, create_tool_calling_agent
from langchain_core.prompts import ChatPromptTemplate

matimo = await Matimo.init(get_tools_path())
lc_tools = convert_tools_to_langchain(
    matimo.list_tools(),
    matimo,
    credentials={'SLACK_BOT_TOKEN': os.environ['SLACK_BOT_TOKEN']},
)
llm = ChatOpenAI(model='gpt-4o-mini')
prompt = ChatPromptTemplate.from_messages([
    ('system', 'You are a Slack assistant.'),
    ('human', '{input}'),
    ('placeholder', '{agent_scratchpad}'),
])
agent = create_tool_calling_agent(llm, lc_tools, prompt)
executor = AgentExecutor(agent=agent, tools=lc_tools)
result = await executor.ainvoke({'input': 'List all public channels'})

Usage Notes

  • The bot must be a member of a channel before it can post messages or read history
  • Use slack_upload_file (not the deprecated files.upload) for file uploads
  • slack_search_messages requires the search:read scope which needs special approval from Slack
  • Rate limits apply - add delays between rapid API calls in bulk operations

Documentation


Metadata

Release files for matimo-slack 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for matimo-slack 0.2.0
File Size Uploaded Provenance Actions
matimo_slack-0.2.0.tar.gz 12.1 kB Without provenance Details for matimo_slack-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for matimo-slack 0.2.0
File Interpreter ABI Platform Actions
matimo_slack-0.2.0-py3-none-any.whl Python 3 none any Details for matimo_slack-0.2.0-py3-none-any.whl

Total release size: 33.7 kB

Release files / matimo_slack-0.2.0.tar.gz

Download URL matimo_slack-0.2.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a444d0636637eef1321956c88216f0bbaa5e549d92b440f32fb1546799b60f8f
BLAKE2b-256 checksum
How to use checksums
f26d48bc76239d8585f002e554250ea16024d6dbbc69bf56518d3623ce7526cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / matimo_slack-0.2.0-py3-none-any.whl

Download URL matimo_slack-0.2.0-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d80aabf802335ebe356889873642fbb88182bbaa2c0cbf6b50a870540cc4300
BLAKE2b-256 checksum
How to use checksums
819cbf6f956bde84a4696e160f1c1cc493f891f2857cddeb1b0e1c832ecd638a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for matimo-slack 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page