Skip to main content
Glama
angheljf

social-media-mcp

post_to_x

Publish messages to X (formerly Twitter) using the social-media-mcp server. Create posts or add to existing threads with required content input.

Instructions

Post a message to X (formerly Twitter)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent of the post
threadIdNoID of the thread to post to

Implementation Reference

  • The handler logic for 'post_to_x' tool that processes the request and interacts with the Twitter client.
    if (request.params.name === "post_to_x") {
        if (!isValidPostArgs(request.params.arguments)) {
            throw new McpError(
                ErrorCode.InvalidParams,
                "Invalid post arguments"
            );
        }
        const { content, threadId } = request.params.arguments;
        try {
            let tweet;
            if (threadId) {
                 const lastPostInThread = this.socialMediaPosts.filter(post => post.threadId === threadId).sort((a,b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime())[0]
                 if(lastPostInThread) {
                    await sleep(2000)
                    tweet = await twitterClient.v2.reply(content, lastPostInThread.tweetId ?? "0")
                 }
                else {
                    await sleep(2000)
                   tweet = await twitterClient.v2.tweet(content)
                 }
           }
           else {
               await sleep(2000)
               tweet = await twitterClient.v2.tweet(content)
           }
        
            const newPost: SocialMediaPost = {
               content,
                platform: "X",
                timestamp: new Date().toISOString(),
               threadId: threadId,
                tweetId: tweet.data.id
            };
           this.socialMediaPosts.push(newPost);
            return {
                 content: [
                    {
                       type: "text",
  • Tool definition including the name and input schema for 'post_to_x'.
    {
        name: "post_to_x",
        description: "Post a message to X (formerly Twitter)",
        inputSchema: {
            type: "object",
            properties: {
                content: { type: "string", description: "Content of the post" },
                threadId: { type: "string", description: "ID of the thread to post to" },
            },
            required: ["content"],
        },
    },
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 reveals minimal behavioral traits. It implies a write operation but omits authentication requirements, visibility rules, rate limits, error conditions, and whether posts are immediate or pending.

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

Conciseness4/5

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

Single sentence is efficient and front-loaded with the core action. However, extreme brevity contributes to informational gaps given the lack of annotations and output schema.

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?

Despite simple 2-parameter structure, the description is inadequate for a publishing tool without annotations. Missing: thread lifecycle guidance (create vs reply), error handling, and side-effect disclosure critical for a public posting operation.

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 coverage is 100% with clear descriptions for both 'content' and 'threadId'. The description adds no additional parameter guidance (e.g., threadId format, when to omit it), warranting the baseline score.

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?

Clear verb 'Post' and resource 'message' with platform identification 'X (formerly Twitter)'. However, it fails to distinguish from sibling 'create_x_thread' regarding when to create a new thread versus posting to an existing one.

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 on when to use 'threadId' versus standalone posting, no mention of prerequisite steps (e.g., obtaining thread IDs), and no reference to sibling tools or alternatives.

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/angheljf/social-media-mcp'

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