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;
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the outcome ('stop seeing their tweets') but lacks details on permissions needed, rate limits, reversibility (e.g., via 'unmuteUser'), or error conditions. For a mutation tool with zero annotation coverage, this is insufficient.

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 zero waste—it directly states the tool's purpose and outcome without unnecessary words or structural fluff.

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?

Given the tool's complexity (a mutation with no annotations, no output schema, and 2 parameters), the description is incomplete. It lacks behavioral details, usage context, and output information, making it inadequate for safe and effective use by an AI agent.

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 already documents both parameters ('userId' and 'username') with clear descriptions. The description adds no additional parameter semantics beyond what the schema provides, meeting the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Mute a user account') and the resource ('user account'), with the explicit outcome ('to stop seeing their tweets in your timeline'). It distinguishes from siblings like 'blockUser' by focusing on timeline filtering rather than blocking interactions.

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?

No guidance is provided on when to use this tool versus alternatives like 'blockUser' or 'unmuteUser', nor any prerequisites or contextual constraints. The description only states what it does, not when or why to use it.

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