Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

removeUserFromList

Remove a specified user from a Twitter list by providing the list ID and username. Streamline list management and maintain organized Twitter curation.

Instructions

Remove a user from a Twitter list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesThe ID of the list
usernameYesThe username of the user to remove

Implementation Reference

  • The main handler function that implements the removeUserFromList tool logic. It checks for Twitter client, removes the list member using the Twitter API, and returns a success or error response.
    export async function handleRemoveUserFromList( client: TwitterClient | null, args: RemoveUserFromListArgs ): Promise<HandlerResponse> { if (!client) { return createMissingTwitterApiKeyResponse('removeUserFromList'); } try { await client.removeListMember(args.listId, args.userId); return createResponse(`Successfully removed user from list ${args.listId}`); } catch (error) { if (error instanceof Error) { throw new Error(formatTwitterError(error, 'removing user from list')); } throw new Error('Failed to remove user from list: Unknown error occurred'); } }
  • src/index.ts:294-297 (registration)
    The dispatch case in the main server request handler that routes calls to 'removeUserFromList' to the handleRemoveUserFromList function.
    case 'removeUserFromList': { const { listId, userId } = request.params.arguments as { listId: string; userId: string }; response = await handleRemoveUserFromList(client, { listId, userId }); break;
  • The tool registration definition including description and input schema (note: schema uses 'username' while handler expects 'userId').
    removeUserFromList: { description: 'Remove a user from a Twitter list', inputSchema: { type: 'object', properties: { listId: { type: 'string', description: 'The ID of the list' }, username: { type: 'string', description: 'The username of the user to remove' } }, required: ['listId', 'username'], },
  • TypeScript interface defining the input arguments for the handler (listId and userId).
    export interface RemoveUserFromListArgs { listId: string; userId: string; }
  • src/index.ts:43-46 (registration)
    Import statement bringing the handleRemoveUserFromList function into the main index for use in dispatching.
    handleRemoveUserFromList, handleGetListMembers, handleGetUserLists } from './handlers/list.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