Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

unmuteUser

Enable interaction with a muted Twitter user by unmuting their account. Provide the user ID or username to restore their content to your feed using the Twitter MCP Server.

Instructions

Unmute a previously muted user account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
userIdNoThe ID of the user to unmute
usernameNoThe username of the user to unmute (alternative to userId)

Implementation Reference

  • The main handler function that implements the unmuteUser tool logic using Twitter API v2.unmute() method. Handles input validation, user ID resolution, and error handling.
    export const handleUnmuteUser: TwitterHandler<UnmuteUserArgs> = async ( client: TwitterClient | null, { userId, username }: UnmuteUserArgs ): Promise<HandlerResponse> => { if (!client) { return createMissingTwitterApiKeyResponse('unmuteUser'); } try { if (!userId && !username) { throw new Error('Either userId or username must be provided'); } let targetUserId = userId; // If username provided, get the user ID first if (username && !userId) { const userResponse = await client.v2.userByUsername(username); if (!userResponse.data) { throw new Error(`User with username '${username}' not found`); } targetUserId = userResponse.data.id; } // Get authenticated user's ID const me = await client.v2.me(); const myUserId = me.data.id; // Unmute the user const result = await client.v2.unmute(myUserId, targetUserId!); return createResponse(`Successfully unmuted user ${username || targetUserId}. Response: ${JSON.stringify(result, null, 2)}`); } catch (error) { if (error instanceof Error) { throw new Error(formatTwitterError(error, 'unmuting user')); } throw error; } };
  • src/index.ts:411-414 (registration)
    Registration and dispatch for the unmuteUser tool in the main MCP server request handler switch statement.
    case 'unmuteUser': { const { userId, username } = request.params.arguments as { userId?: string; username?: string }; response = await handleUnmuteUser(client, { userId, username }); break;
  • MCP tool schema definition for unmuteUser, including description and input schema used for tool listing and validation.
    unmuteUser: { description: 'Unmute a previously muted user account', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'The ID of the user to unmute' }, username: { type: 'string', description: 'The username of the user to unmute (alternative to userId)' } }, required: [] } },
  • TypeScript interface defining the input arguments for the unmuteUser handler.
    export interface UnmuteUserArgs { userId?: string; username?: string; }

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/crazyrabbitLTC/mcp-twitter-server'

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