Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

removeUserFromList

Remove a Twitter user from a specified list by providing the list ID and username.

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

  • Core handler function that executes the removal of a user from a Twitter list using the Twitter API client. Handles missing client, calls removeListMember, and manages errors.
    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');
        }
    }
  • MCP tool schema definition for removeUserFromList, specifying the input parameters listId and username (note: handler expects userId). This is used for tool registration.
    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'],
        },
    },
  • src/index.ts:294-297 (registration)
    Dispatch/registration in the main request handler switch case, mapping tool call to the handleRemoveUserFromList function.
    case 'removeUserFromList': {
        const { listId, userId } = request.params.arguments as { listId: string; userId: string };
        response = await handleRemoveUserFromList(client, { listId, userId });
        break;
  • TypeScript interface defining the arguments for the handler (listId and userId).
    export interface RemoveUserFromListArgs {
        listId: string;
        userId: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits such as permissions required (e.g., must own the list), rate limits, whether removal is reversible, or error conditions (e.g., if user isn't in list). This is inadequate for a mutation tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral context (e.g., effects, errors), usage guidelines, and output expectations, leaving significant gaps for the agent to operate effectively.

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?

Schema description coverage is 100%, so the schema fully documents both parameters ('listId' and 'username'). The description adds no additional meaning beyond implying these parameters are used for removal, meeting the baseline score without compensating for gaps.

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 ('Remove') and target ('a user from a Twitter list'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'getListMembers' or 'unfollowUser' which might involve similar user-list operations, so it doesn't reach the highest score.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing list ownership), exclusions, or relationships with siblings like 'addUserToList' or 'getListMembers', leaving the agent to infer usage context.

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

Install Server

Other Tools

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