Skip to main content
Glama
angheljf

social-media-mcp

create_x_thread

Create and publish threaded posts on X (formerly Twitter) to share extended content through connected messages.

Instructions

Create a thread on X (formerly Twitter)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent of the first post

Implementation Reference

  • The implementation of the create_x_thread tool, which posts content to Twitter/X via the twitterClient.
    else if (request.params.name === "create_x_thread") {
        if (!isValidPostArgs(request.params.arguments)) {
               throw new McpError(
                   ErrorCode.InvalidParams,
                   "Invalid post arguments"
                );
        }
           const { content } = request.params.arguments;
           try {
               await sleep(2000)
                   const tweet = await twitterClient.v2.tweet(content)
               const threadId = tweet.data.id;
               const newPost: SocialMediaPost = {
                   content,
                   platform: "X",
                   timestamp: new Date().toISOString(),
                   threadId: threadId,
                   tweetId: tweet.data.id
               };
               this.socialMediaPosts.push(newPost);
               return {
                   content: [
                       {
                           type: "text",
                          text: `Successfully created X thread: ${content}. Thread ID: ${threadId}`,
                      },
                   ],
              };
          } catch (error: any) {
               return {
                   isError: true,
                   content: [
                       {
                           type: "text",
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/angheljf/social-media-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server