Skip to main content
Glama

delete_invite

Remove Discord server invites by providing an invite code to manage access and maintain server security.

Instructions

Delete an invite

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inviteCodeYesThe invite code to delete
reasonNoReason for deleting

Implementation Reference

  • The handler function that implements the core logic of the delete_invite tool: fetches the Discord client, retrieves the invite, deletes it with optional reason, wraps in error handling, and formats the response.
    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) }] }; }
  • Zod input schema defining parameters for the delete_invite tool: required inviteCode and optional reason.
    { inviteCode: z.string().describe('The invite code to delete'), reason: z.string().optional().describe('Reason for deleting'), },
  • MCP server.tool registration for delete_invite, including name, description, schema, and handler function.
    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) }] }; } );

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