Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

getMutedUsers

Retrieve a paginated list of users you have muted on Twitter to manage your account's mute settings and review muted profiles.

Instructions

Retrieve a paginated list of users you have muted

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxResultsNoMaximum number of muted users to return (default: 100, max: 1000)
paginationTokenNoPagination token for retrieving next page of results
userFieldsNoUser fields to include in the response

Implementation Reference

  • Core handler function that implements the getMutedUsers tool logic using Twitter API v2.userMutingUsers to retrieve paginated list of muted users.
    export const handleGetMutedUsers: TwitterHandler<GetMutedUsersArgs> = async (
        client: TwitterClient | null,
        { maxResults = 100, paginationToken, userFields }: GetMutedUsersArgs
    ): Promise<HandlerResponse> => {
        if (!client) {
            return createMissingTwitterApiKeyResponse('getMutedUsers');
        }
        
        try {
            // Get authenticated user's ID
            const me = await client.v2.me();
            const myUserId = me.data.id;
    
            const options: any = {
                max_results: Math.min(maxResults, 1000) // API max is 1000
            };
    
            if (paginationToken) {
                options.pagination_token = paginationToken;
            }
    
            if (userFields && userFields.length > 0) {
                options['user.fields'] = userFields.join(',');
            } else {
                // Default user fields for better response
                options['user.fields'] = 'id,name,username,public_metrics,description,verified';
            }
    
            const mutedUsers = await client.v2.userMutingUsers(myUserId, options);
    
            // The paginator returns data nested: { data: [users], meta: {...} }
            const userData = mutedUsers.data?.data;
            const metaData = mutedUsers.data?.meta || mutedUsers.meta;
    
            if (!userData || !Array.isArray(userData) || userData.length === 0) {
                return createResponse('No muted users found.');
            }
    
            const responseData = {
                mutedUsers: userData,
                meta: metaData
            };
    
            return createResponse(`Retrieved ${userData.length} muted users: ${JSON.stringify(responseData, null, 2)}`);
        } catch (error) {
            if (error instanceof Error) {
                throw new Error(formatTwitterError(error, 'getting muted users'));
            }
            throw error;
        }
    };
  • TypeScript interface defining input arguments for the getMutedUsers handler.
    export interface GetMutedUsersArgs {
        maxResults?: number;
        paginationToken?: string;
        userFields?: string[];
    }
  • src/tools.ts:708-734 (registration)
    Tool registration in TOOLS object including description and inputSchema for MCP protocol.
    getMutedUsers: {
        description: 'Retrieve a paginated list of users you have muted',
        inputSchema: {
            type: 'object',
            properties: {
                maxResults: { 
                    type: 'number', 
                    description: 'Maximum number of muted users to return (default: 100, max: 1000)',
                    minimum: 1,
                    maximum: 1000
                },
                paginationToken: { 
                    type: 'string', 
                    description: 'Pagination token for retrieving next page of results' 
                },
                userFields: { 
                    type: 'array', 
                    items: { 
                        type: 'string',
                        enum: ['id', 'name', 'username', 'description', 'profile_image_url', 'public_metrics', 'verified', 'location', 'url']
                    },
                    description: 'User fields to include in the response' 
                }
            },
            required: []
        }
    },
  • src/index.ts:416-423 (registration)
    Handler dispatch in main server request handler switch statement for 'getMutedUsers' tool calls.
    case 'getMutedUsers': {
        const { maxResults, paginationToken, userFields } = request.params.arguments as { 
            maxResults?: number; 
            paginationToken?: string; 
            userFields?: string[] 
        };
        response = await handleGetMutedUsers(client, { maxResults, paginationToken, userFields });
        break;
  • src/index.ts:60-66 (registration)
    Import statement registering the handleGetMutedUsers function for use in the main index dispatcher.
        handleBlockUser,
        handleUnblockUser,
        handleGetBlockedUsers,
        handleMuteUser,
        handleUnmuteUser,
        handleGetMutedUsers
    } from './handlers/moderation.handlers.js';

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