Skip to main content
Glama
by oregpt
check-bot-access.js•2.64 kB
// Check what the bot can actually access import dotenv from 'dotenv'; dotenv.config(); import { WebClient } from '@slack/web-api'; const TEST_TOKEN = process.env.SLACK_TEST_TOKEN; const client = new WebClient(TEST_TOKEN); console.log('šŸ” Checking Bot Access and Permissions\n'); console.log('='.repeat(60)); async function checkAccess() { try { // Check auth console.log('\n1. Checking authentication...'); const authTest = await client.auth.test(); console.log('āœ… Token is valid!'); console.log(` Bot User ID: ${authTest.user_id}`); console.log(` Bot Name: ${authTest.user}`); console.log(` Team: ${authTest.team}`); // Get bot info console.log('\n2. Getting bot information...'); const botInfo = await client.bots.info({ bot: authTest.user_id }); console.log(` Bot Name: ${botInfo.bot.name}`); console.log(` App ID: ${botInfo.bot.app_id}`); // List conversations the bot is in console.log('\n3. Checking channels bot is a member of...'); const conversations = await client.users.conversations({ types: 'public_channel,private_channel', limit: 100 }); if (conversations.channels.length > 0) { console.log(`āœ… Bot is a member of ${conversations.channels.length} channels:`); conversations.channels.forEach(ch => { console.log(` - #${ch.name} (${ch.id})`); }); } else { console.log('āš ļø Bot is NOT a member of any channels!'); console.log('\n To add bot to #testing:'); console.log(' 1. Go to #testing in Slack'); console.log(' 2. Click channel name → Integrations tab'); console.log(' 3. Click "Add apps"'); console.log(` 4. Search for "${authTest.user}" and add it`); } // Try to find #testing channel console.log('\n4. Looking for #testing channel...'); const allChannels = await client.conversations.list({ types: 'public_channel,private_channel', limit: 200 }); const testingChannel = allChannels.channels.find(ch => ch.name === 'testing'); if (testingChannel) { console.log(`āœ… Found #testing channel: ${testingChannel.id}`); console.log(` Members: ${testingChannel.num_members}`); console.log(` Is member: ${testingChannel.is_member ? 'YES āœ…' : 'NO āŒ'}`); if (!testingChannel.is_member) { console.log('\n āš ļø Bot sees the channel but is NOT a member!'); console.log(` Add the bot "${authTest.user}" to #testing channel.`); } } } catch (error) { console.error('āŒ Error:', error.data?.error || error.message); } } checkAccess();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oregpt/Agenticledger_MCP_Slack'

If you have feedback or need assistance with the MCP directory API, please join our Discord server