Skip to main content
Glama

join_channel

Connect to a specific Figma channel to enable communication between Cursor AI and Figma designs for programmatic reading and modification.

Instructions

Join a specific channel to communicate with Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelNoThe name of the channel to join

Implementation Reference

  • MCP tool registration for 'join_channel', including schema and handler function that calls joinChannel to connect to a WebSocket channel for Figma communication.
    server.tool(
      "join_channel",
      "Join a specific channel to communicate with Figma",
      {
        channel: z.string().describe("The name of the channel to join").default(""),
      },
      async ({ channel }) => {
        try {
          if (!channel) {
            // If no channel provided, ask the user for input
            return {
              content: [
                {
                  type: "text",
                  text: "Please provide a channel name to join:",
                },
              ],
              followUp: {
                tool: "join_channel",
                description: "Join the specified channel",
              },
            };
          }
    
          await joinChannel(channel);
          return {
            content: [
              {
                type: "text",
                text: `Successfully joined channel: ${channel}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error joining channel: ${error instanceof Error ? error.message : String(error)
                  }`,
              },
            ],
          };
        }
      }
    );
  • Handler helper function 'joinChannel' that sends the 'join' command via WebSocket to the socket server, setting the current channel.
    async function joinChannel(channelName: string): Promise<void> {
      if (!ws || ws.readyState !== WebSocket.OPEN) {
        throw new Error("Not connected to Figma");
      }
    
      try {
        await sendCommandToFigma("join", { channel: channelName });
        currentChannel = channelName;
        logger.info(`Joined channel: ${channelName}`);
      } catch (error) {
        logger.error(`Failed to join channel: ${error instanceof Error ? error.message : String(error)}`);
        throw error;
      }
    }
  • Zod schema for join_channel tool input: channel name (string, default empty).
    {
      channel: z.string().describe("The name of the channel to join").default(""),
  • WebSocket server handles client disconnection from channels (related to join_channel functionality).
          channels.forEach((clients) => {
            clients.delete(ws);
          });
        }
      }
    });
    
    console.log(`WebSocket server running on port ${server.port}`);
  • WebSocket server handler for 'join' type messages, which implements the channel joining logic used by the MCP tool.
    if (data.type === "join") {
      const channelName = data.channel;
      if (!channelName || typeof channelName !== "string") {
        ws.send(JSON.stringify({
          type: "error",
          message: "Channel name is required"
        }));
        return;
      }
    
      // Create channel if it doesn't exist
      if (!channels.has(channelName)) {
        channels.set(channelName, new Set());
      }
    
      // Add client to channel
      const channelClients = channels.get(channelName)!;
      channelClients.add(ws);
    
      // Notify client they joined successfully
      ws.send(JSON.stringify({
        type: "system",
        message: `Joined channel: ${channelName}`,
        channel: channelName
      }));
    
      console.log("Sending message to client:", data.id);
    
      ws.send(JSON.stringify({
        type: "system",
        message: {
          id: data.id,
          result: "Connected to channel: " + channelName,
        },
        channel: channelName
      }));
    
      // Notify other clients in channel
      channelClients.forEach((client) => {
        if (client !== ws && client.readyState === WebSocket.OPEN) {
          client.send(JSON.stringify({
            type: "system",
            message: "A new user has joined the channel",
            channel: channelName
          }));
        }
      });
      return;

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / channel
      Added value: +{
      +  "default": "",
      +  "description": "The name of the channel to join",
      +  "type": "string"
      +}
  2. First observed

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavioral traits. It only states the action but does not disclose side effects, whether joining requires an existing channel, whether it modifies state, whether it can be undone, or what happens after joining. This is a significant gap for a state-changing operation.

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?

The description is a single, concise sentence that front-loads the core action. It has no filler or redundant information, and it is appropriately sized for a tool with one parameter.

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

Completeness3/5

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

For a simple tool with one parameter and no output schema, the description provides the basic function but lacks context about what a 'channel' is in Figma, what communication entails, and any behavioral details. Given the tool's simplicity, the description is adequate but not complete, leaving a notable gap in understanding the tool's role in the overall workflow.

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

Parameters3/5

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

The input schema already provides 100% coverage for the only parameter, describing 'channel' as 'The name of the channel to join'. The description adds nothing beyond the schema, using the word 'specific' without providing additional meaning. Thus, the score is at the baseline for high schema coverage.

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

Purpose4/5

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

The description 'Join a specific channel to communicate with Figma' clearly names the action (join) and the resource (channel), and implies a purpose. It distinguishes itself from sibling tools by focusing on the channel concept, which none of the siblings mention. However, the exact nature of the channel (e.g., comment feed, plugin communication) is left undefined, so it is not fully explicit.

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

Usage Guidelines3/5

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

The description implies the usage context (you join a channel to communicate with Figma) but does not explicitly state when to use this tool versus alternatives, nor does it mention any prerequisites or conditions. There are no alternative join tools among siblings, which reduces the need for exclusions, but the description still lacks concrete guidance on when the tool is appropriate.

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