Skip to main content
Glama
CharityDEX

VoiceOS Discord MCP Server

by CharityDEX

connect_discord_bot

Authenticate a Discord bot or account by creating a Composio Connect link. Use this when the user asks to connect or another tool reports missing authentication.

Instructions

Create a Composio Connect Link for authenticating the Discord bot/account connection. Use this whenever the user asks to connect Discord, or whenever another Discord tool reports that authentication is required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the connect_discord_bot MCP tool. Creates a Composio Connect Link for Discord bot/account authentication, attempts to open it in a browser, and returns a formatted message to the user.
    server.tool(
      "connect_discord_bot",
      "Create a Composio Connect Link for authenticating the Discord bot/account connection. Use this whenever the user asks to connect Discord, or whenever another Discord tool reports that authentication is required.",
      {},
      async () => {
        const redirectUrl = await createDiscordConnectLink();
        const openedBrowser = openUrlInBrowser(redirectUrl);
        return textResponse(formatConnectLinkMessage(redirectUrl, openedBrowser));
      }
    );
  • index.ts:566-575 (registration)
    Registration of the 'connect_discord_bot' tool on the McpServer instance using server.tool(). The tool has no input parameters (empty schema object).
    server.tool(
      "connect_discord_bot",
      "Create a Composio Connect Link for authenticating the Discord bot/account connection. Use this whenever the user asks to connect Discord, or whenever another Discord tool reports that authentication is required.",
      {},
      async () => {
        const redirectUrl = await createDiscordConnectLink();
        const openedBrowser = openUrlInBrowser(redirectUrl);
        return textResponse(formatConnectLinkMessage(redirectUrl, openedBrowser));
      }
    );
  • The tool's input schema is an empty object (no parameters required).
    {},
  • Helper function that creates a Composio authorization link for the DISCORDBOT toolkit. Uses either a configured auth config or the session's default authorization.
    async function createDiscordConnectLink(): Promise<string> {
      const connectionRequest = COMPOSIO_AUTH_CONFIG_ID
        ? await composio.toolkits.authorize(
            composioUserId,
            COMPOSIO_TOOLKIT_SLUG,
            COMPOSIO_AUTH_CONFIG_ID
          )
        : await (await getSession()).authorize(COMPOSIO_TOOLKIT_SLUG);
      const redirectUrl = connectionRequest.redirectUrl
        ? normalizeComposioConnectUrl(connectionRequest.redirectUrl)
        : null;
    
      if (!redirectUrl) {
        throw new Error(
          "Composio did not return a Discord connect link. Check the DISCORDBOT auth configuration in Composio."
        );
      }
    
      return redirectUrl;
    }
  • Helper function that formats the user-facing message when the connect link is generated, indicating whether the browser was opened successfully.
    function formatConnectLinkMessage(redirectUrl: string, openedBrowser: boolean): string {
      return [
        "Discord is connected to VoiceOS, but your Discord bot/account connection is not authenticated in Composio yet.",
        "",
        openedBrowser
          ? "I opened the Composio Discord connection page in your browser."
          : "I could not open the Composio Discord connection page automatically.",
        "",
        "I am intentionally not printing the Composio URL because VoiceOS link handling has been corrupting Composio hostnames in chat.",
        "",
        "After completing authentication, retry your Discord request.",
      ].join("\n");
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It clearly states it creates a link for authentication, which is a non-destructive action. However, it omits details about the output (e.g., returns a URL) or whether user interaction is needed, so it's not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero wasted words. Front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description is mostly complete. It explains purpose and usage. A minor gap is not describing the return value (e.g., a URL), but it's not critical for selection.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so the description need not add parameter info. Baseline score of 4 is appropriate since no compensation is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: creating a Composio Connect Link for Discord bot authentication. It uses specific verbs ('Create') and resources ('Composio Connect Link for authenticating the Discord bot/account connection'), and is distinct from sibling tools that focus on channels, servers, and messages.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use: 'whenever the user asks to connect Discord' or 'whenever another Discord tool reports that authentication is required.' This provides clear context and excludes alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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