Skip to main content
Glama
crazyrabbitLTC

Twitter MCP Server

markAsRead

Mark Twitter direct messages as read to manage your inbox and track conversations. Requires message ID input and may need special API access.

Instructions

Mark direct messages as read (Note: May require special API access)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageIdYesThe ID of the message to mark as read
conversationIdNoOptional conversation ID for context

Implementation Reference

  • The main handler function that executes the markAsRead tool logic, checking for Twitter client and attempting to mark the message as read (placeholder implementation noting API limitations).
    export const handleMarkAsRead: TwitterHandler<MarkAsReadArgs> = async ( client: TwitterClient | null, { messageId, conversationId }: MarkAsReadArgs ): Promise<HandlerResponse> => { if (!client) { return createMissingTwitterApiKeyResponse('markAsRead'); } try { // Note: The Twitter API v2 doesn't have a direct "mark as read" endpoint // This would typically be handled through the conversation update endpoint // For now, we'll provide a placeholder implementation // In a real implementation, you might need to: // 1. Get the authenticated user's ID // 2. Update the conversation state // 3. Use private API endpoints that may not be publicly available const userId = await client.v2.me().then(response => response.data.id); // This is a conceptual implementation - the actual API endpoint may vary // The Twitter API v2 may not expose this functionality directly console.log(`Attempting to mark message ${messageId} as read for user ${userId}`); return createResponse(`Message ${messageId} marked as read. Note: This functionality may require special API access or may not be available in the public Twitter API v2.`); } catch (error) { if (error instanceof Error) { if (error.message.includes('404')) { throw new Error(`Failed to mark message as read: Message ${messageId} not found.`); } throw new Error(`${formatTwitterError(error, 'marking message as read')}. Note: This functionality may not be available in the public Twitter API v2.`); } throw error; } };
  • src/tools.ts:565-581 (registration)
    Tool registration in the TOOLS object, defining the description and input schema for the markAsRead tool used by MCP.
    markAsRead: { description: 'Mark direct messages as read (Note: May require special API access)', inputSchema: { type: 'object', properties: { messageId: { type: 'string', description: 'The ID of the message to mark as read' }, conversationId: { type: 'string', description: 'Optional conversation ID for context' } }, required: ['messageId'] } },
  • TypeScript interface defining the input arguments for the markAsRead handler.
    export interface MarkAsReadArgs { messageId: string; conversationId?: string; }
  • src/index.ts:368-374 (registration)
    Dispatch/registration in the main server request handler switch statement that routes calls to the markAsRead tool to its handler function.
    case 'markAsRead': { const { messageId, conversationId } = request.params.arguments as { messageId: string; conversationId?: string; }; response = await handleMarkAsRead(client, { messageId, conversationId }); break;

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