Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

muteUser

Stop seeing a specific user's tweets in your timeline by muting their account using their user ID or username.

Instructions

Mute a user account to stop seeing their tweets in your timeline

Input Schema

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

Implementation Reference

  • The handler function that implements the muteUser tool logic, muting a Twitter user by resolving user ID if needed and calling the Twitter v2 mute API.
    export const handleMuteUser: TwitterHandler<MuteUserArgs> = async ( client: TwitterClient | null, { userId, username }: MuteUserArgs ): Promise<HandlerResponse> => { if (!client) { return createMissingTwitterApiKeyResponse('muteUser'); } 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; // Mute the user const result = await client.v2.mute(myUserId, targetUserId!); return createResponse(`Successfully muted user ${username || targetUserId}. Response: ${JSON.stringify(result, null, 2)}`); } catch (error) { if (error instanceof Error) { throw new Error(formatTwitterError(error, 'muting user')); } throw error; } };
  • The MCP tool schema definition for muteUser, including description and input schema validation.
    muteUser: { description: 'Mute a user account to stop seeing their tweets in your timeline', inputSchema: { type: 'object', properties: { userId: { type: 'string', description: 'The ID of the user to mute' }, username: { type: 'string', description: 'The username of the user to mute (alternative to userId)' } }, required: [] }
  • src/index.ts:406-409 (registration)
    Registration and dispatch logic in the main CallToolRequest handler switch statement that invokes the muteUser handler.
    case 'muteUser': { const { userId, username } = request.params.arguments as { userId?: string; username?: string }; response = await handleMuteUser(client, { userId, username }); break;
  • TypeScript type definition for the MuteUserArgs used by the handler.
    export interface MuteUserArgs { 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