Home/Tools/@tpmjs/tools-discord

createChannel

@tpmjs/tools-discord

Create a new text or voice channel in a Discord guild.

Official
ops
v0.1.0
MIT
⚠️

This tool is currently broken

Execution Failed
Runtime error with test parameters
Failed to create channel: Bad request: Invalid Form Body (Discord Error Code: 50035)

Last checked: 3/1/2026, 4:29:33 AM

Interactive Playground

Test @tpmjs/tools-discord (createChannel) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @tpmjs/tools-discord
pnpm add @tpmjs/tools-discord
yarn add @tpmjs/tools-discord
bun add @tpmjs/tools-discord
deno add npm:@tpmjs/tools-discord

2. Import the tool

import { createChannel } from '@tpmjs/tools-discord';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { createChannel } from '@tpmjs/tools-discord';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { createChannel },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(name: string, guild_id: string, type?: number, topic?: string, parent_id?: string) => Promise<unknown>

Tags

agent
channel
create
discord
guild
messaging
new
ops
text
tpmjs
voice

Parameters

Available configuration options

Auto-extracted
guild_id
Required
Type: string

The ID of the guild to create the channel in.

name
Required
Type: string

The name of the channel (1-100 characters).

type
Optional
Type: number

Channel type: 0=text, 2=voice, 4=category, 5=announcement (default: 0).

topic
Optional
Type: string

Channel topic (0-1024 characters, text channels only).

parent_id
Optional
Type: string

ID of the parent category for the channel.

Schema extracted: 3/1/2026, 4:29:32 AM

README

@tpmjs/tools-discord

Discord API tools for AI agents. Send messages, manage guilds, channels, threads, members, reactions, and more.

Installation

npm install @tpmjs/tools-discord

Setup

Set the DISCORD_BOT_TOKEN environment variable. Get your token from Discord Developer Portal.

Required bot permissions: Send Messages, Read Message History, Manage Messages, Manage Channels, Add Reactions, Manage Threads.

Usage

import { sendMessage, listGuilds } from '@tpmjs/tools-discord';

const result = await sendMessage.execute({ channel_id: '123456789', content: 'Hello from AI!' });
const guilds = await listGuilds.execute({});

Tools

ToolDescription
sendMessageSend a message to a channel
listGuildsList guilds the bot is in
getGuildGet guild details
listChannelsList guild channels
getChannelGet channel details
listMessagesGet recent messages from a channel
createChannelCreate a text/voice/category channel
editMessageEdit a previously sent message
deleteMessageDelete a message
addReactionAdd emoji reaction to a message
listMembersList guild members
getMemberGet member details
createThreadCreate a thread from a message
listThreadsList active threads
pinMessagePin a message

License

MIT

Statistics

Downloads/month

49

GitHub Stars

8

Quality Score

85%

Bundle Size

NPM Keywords

tpmjs
discord
messaging
ops
agent

Maintainers

thomasdavis(thomasalwyndavis@gmail.com)

Frameworks

vercel-ai
createChannel | TPMJS | TPMJS