Skip to main content
Glama
arinspunk

Claude Talk to Figma MCP

by arinspunk

join_channel

Open a named channel to begin direct communication with Figma, enabling AI-assisted design actions through natural language commands.

Instructions

Join a specific channel to communicate with Figma

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channelYesThe name of the channel to join

Implementation Reference

  • Registration of the 'join_channel' tool on the MCP server, defining its schema (channel string) and handler callback.
    // Join Channel Tool
    server.tool(
      "join_channel",
      "Join a specific channel to communicate with Figma",
      {
        channel: z.string().describe("The name of the channel to join"),
      },
      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",
              },
            };
          }
    
          // Use joinChannel instead of sendCommandToFigma to ensure currentChannel is updated
          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)}`,
              },
            ],
          };
        }
      }
    );
  • The joinChannel function that sends 'join' command via WebSocket to Figma, updates currentChannel, and verifies with a ping.
    export 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;
    
        try {
          await sendCommandToFigma("ping", {}, 12000);
          logger.info(`Joined channel: ${channelName}`);
        } catch (verificationError) {
          currentChannel = null;
          const errorMsg = verificationError instanceof Error
            ? verificationError.message
            : String(verificationError);
          logger.error(`Failed to verify channel ${channelName}: ${errorMsg}`);
          throw new Error(`Failed to verify connection to channel "${channelName}". The Figma plugin may not be connected to this channel.`);
        }
      } catch (error) {
        logger.error(`Failed to join channel: ${error instanceof Error ? error.message : String(error)}`);
        throw error;
      }
  • Input schema for the join_channel tool: requires a 'channel' string parameter.
    {
      channel: z.string().describe("The name of the channel to join"),
  • Import of the joinChannel helper function from the websocket utility.
    import { sendCommandToFigma, joinChannel } from "../utils/websocket.js";

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.8.2
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / channel / default
      Removed value: -""
    • addedInput schema / required
      Added value: +[
      +  "channel"
      +]
  2. 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"
      +}
  3. First observed

TDQS

C2.8/5.0
Behavior2/5

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

Annotations are absent, so the description must disclose side effects, permissions, or state changes. It only says 'join' and 'communicate', with no indication of what happens upon joining, whether it's reversible, or if any permissions are required. This is insufficient for a mutation tool.

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

Conciseness3/5

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

The description is very short (one sentence), which risks under-specification. While it avoids fluff, it omits crucial details, making it less effective. It is concise but incomplete.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description should provide more context about return values, side effects, and prerequisites. For a state-changing tool like 'join_channel', this description is inadequate.

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 describes the sole parameter ('channel') with full coverage (100%). The description adds no additional semantic value beyond what the schema provides, so a score of 3 is appropriate.

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 clearly states the action (join) and the resource (channel). However, the phrase 'to communicate with Figma' is vague; it doesn't specify what joining a channel entails. Nonetheless, the core purpose is evident and distinct from sibling tools.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. For instance, there is a sibling 'list_active_channels' that might be a prerequisite, but no hints are given. The description offers no usage context or exclusions.

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

Deploy Server

Other Tools