Skip to main content
Glama
olamide-olaniyan

SociaVault MCP Server

get_twitter_tweets

Retrieve tweets from any Twitter/X user by providing their username. This tool accesses Twitter data through the SociaVault MCP Server for social media analysis and content extraction.

Instructions

Get tweets from a Twitter/X user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handleYesTwitter username

Implementation Reference

  • Executes the get_twitter_tweets tool by calling the Sociavault API endpoint /twitter/user-tweets with the handle, extracts tweets using helper, and returns JSON stringified response.
    if (name === "get_twitter_tweets") {
      const { handle } = args as { handle: string };
      const response = await axios.get(`${BASE_URL}/twitter/user-tweets`, {
        headers: { "X-API-Key": API_KEY },
        params: { handle },
      });
      const extracted = extractTwitterTweets(response.data, 10);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              { handle, tweets: extracted, total_returned: extracted.length },
              null,
              2
            ),
          },
        ],
      };
    }
  • src/index.ts:278-288 (registration)
    Registers the get_twitter_tweets tool in the tools list with name, description, and input schema requiring 'handle'.
    {
      name: "get_twitter_tweets",
      description: "Get tweets from a Twitter/X user",
      inputSchema: {
        type: "object",
        properties: {
          handle: { type: "string", description: "Twitter username" },
        },
        required: ["handle"],
      },
    },
  • Helper function to extract and format up to 10 tweets from the API response data.
    function extractTwitterTweets(data: any, limit = 10) {
      const tweets = data?.data?.tweets || data?.tweets || data?.data || [];
      const tweetsArray = Array.isArray(tweets) ? tweets : tweets.timeline || [];
      return tweetsArray.slice(0, limit).map((tweet: any) => {
        return {
          id: tweet.id_str || tweet.id,
          text: tweet.full_text || tweet.text,
          created_at: tweet.created_at,
          retweets: tweet.retweet_count || 0,
          likes: tweet.favorite_count || tweet.like_count || 0,
          replies: tweet.reply_count || 0,
          is_retweet: tweet.retweeted || false,
        };
      });
    }
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 but offers minimal insight. It implies a read operation ('Get') but doesn't specify whether it's safe, if it requires authentication, what the return format is, or any constraints like rate limits or data recency. This leaves significant gaps for an agent to understand how the tool behaves.

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, clear sentence with no wasted words, making it highly concise and front-loaded. It directly communicates the core function without unnecessary elaboration, which is efficient for an agent's quick understanding.

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 tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'tweets' are returned (e.g., count, format, or fields), any behavioral traits like pagination or errors, or how it integrates with sibling tools. Given the complexity of social media data retrieval, more context is needed for effective use.

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?

The input schema has 100% description coverage, with the 'handle' parameter documented as 'Twitter username'. The description adds no additional semantic context beyond this, such as format examples (e.g., '@username' or plain 'username') or usage notes. Given the high schema coverage, a baseline score of 3 is appropriate as the schema does the heavy lifting.

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 ('Get tweets') and target resource ('from a Twitter/X user'), making the purpose understandable. It distinguishes from sibling tools like 'get_twitter_profile' by focusing on tweets rather than profile data. However, it lacks specificity about what 'get' entails (e.g., recent tweets, all tweets, or a limited set).

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. It doesn't mention prerequisites (e.g., authentication), limitations (e.g., rate limits or data availability), or how it differs from similar tools like 'get_instagram_posts' or 'get_threads_posts' in terms of functionality or 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/olamide-olaniyan/sociavault-mcp'

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