Skip to main content
Glama

delete_invite

Remove a Discord invite link by providing its code to manage server access and maintain security.

Instructions

Delete an invite

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inviteCodeYesThe invite code to delete
reasonNoReason for deleting

Implementation Reference

  • Registration and implementation of the delete_invite tool, including schema, handler logic to fetch and delete the Discord invite.
    server.tool( 'delete_invite', 'Delete an invite', { inviteCode: z.string().describe('The invite code to delete'), reason: z.string().optional().describe('Reason for deleting'), }, async ({ inviteCode, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const invite = await client.fetchInvite(inviteCode); await invite.delete(reason); return { inviteCode, message: 'Invite deleted successfully' }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } );
  • Handler function that executes the delete_invite tool: fetches the invite via Discord client and deletes it with optional reason.
    async ({ inviteCode, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const invite = await client.fetchInvite(inviteCode); await invite.delete(reason); return { inviteCode, message: 'Invite deleted successfully' }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
  • Input schema for delete_invite tool using Zod: requires inviteCode, optional reason.
    inviteCode: z.string().describe('The invite code to delete'), reason: z.string().optional().describe('Reason for deleting'), },
  • src/index.ts:62-62 (registration)
    Calls registerInviteTools to register all invite tools including delete_invite.
    registerInviteTools(server);

Latest Blog Posts

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/scarecr0w12/discord-mcp'

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