Estimated time to complete: 5 minutes

Overview
Welcome to Magma! 🌋 This template will help you create:- An AI agent hosted on Magma
- A Slack app connected to your agent
- Interactive chat with your agent right in your Slack workspace
Prerequisites:
- A Slack workspace where you have admin permissions
Getting Started
First, we need the Magma CLI to clone the Slack DM template, and save it to your Magma account.Use the Slack DM Template
The
magma init command is how you create a new Magma agent project. If you provide the -t flag, it will use the template you specify. Here, we’re using the slack-dm template.Slack App Setup
Manifest Configuration
The
manifest.json file in your project root contains all the necessary Slack app configurations. You only need to update two values.Required Changes
Required Changes
AGENT_NAMEin thedisplay_informationsectionAGENT_IDin thesettings.event_subscriptions.request_urlsection
What these values mean
What these values mean
AGENT_NAMEis what users will see when they interact with your botAGENT_IDis used to route Slack events to your specific Magma agent
Creating Your Slack App
Create New App
- Go to https://api.slack.com/apps
- Click “Create an app”
- Select “From a manifest”
Installing the App
Install to Workspace
- Navigate to “OAuth & Permissions”
- Click “Install to Workspace”
- Approve the requested permissions
Deployment
- Deploy your agent to Magma’s infrastructure
- Set up the webhook endpoint for Slack events
- Enable real-time communication between Slack and your agent
After deployment, go to your Slack App settings > Event Subscriptions and verify that the Request URL shows as “Verified”. If it’s not verified, double-check your
AGENT_ID in the manifest.json.Testing Your Agent
- Open your Slack workspace
- Search for your agent by name
- Start a DM conversation
- Send a message to test the connection