Skip to main content
Glama
olamide-olaniyan

SociaVault MCP Server

get_threads_posts

Retrieve posts from a Threads user by providing their username. This tool extracts social media content for analysis or monitoring purposes.

Instructions

Get posts from a Threads user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handleYesThreads username

Implementation Reference

  • Handler logic for the 'get_threads_posts' tool. Makes an API call to Sociavault to fetch Threads user posts, extracts the data using extractThreadsPosts, and returns formatted JSON response.
    if (name === "get_threads_posts") {
      const { handle } = args as { handle: string };
      const response = await axios.get(`${BASE_URL}/threads/user/posts`, {
        headers: { "X-API-Key": API_KEY },
        params: { handle },
      });
      const extracted = extractThreadsPosts(response.data, 10);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              { handle, posts: extracted, total_returned: extracted.length },
              null,
              2
            ),
          },
        ],
      };
    }
  • src/index.ts:289-299 (registration)
    Tool registration entry in the tools array, including name, description, and input schema. Used by ListToolsRequestHandler.
    {
      name: "get_threads_posts",
      description: "Get posts from a Threads user",
      inputSchema: {
        type: "object",
        properties: {
          handle: { type: "string", description: "Threads username" },
        },
        required: ["handle"],
      },
    },
  • Input schema definition for the 'get_threads_posts' tool, specifying the required 'handle' parameter.
      inputSchema: {
        type: "object",
        properties: {
          handle: { type: "string", description: "Threads username" },
        },
        required: ["handle"],
      },
    },
  • Helper function to extract and format Threads posts data from the API response, limiting to 10 posts.
    function extractThreadsPosts(data: any, limit = 10) {
      const posts = data?.data?.threads || data?.threads || data?.data || [];
      const postsArray = Array.isArray(posts) ? posts : [];
      return postsArray.slice(0, limit).map((post: any) => {
        return {
          id: post.id || post.pk,
          text: post.caption?.text || post.text || "",
          likes: post.like_count || post.likes || 0,
          replies: post.replies_count || post.replies || 0,
          reposts: post.repost_count || 0,
          timestamp: post.taken_at || post.created_at,
        };
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It states what the tool does but doesn't cover critical aspects like whether it's read-only, rate limits, authentication needs, pagination, error handling, or what format the posts are returned in. For a tool with zero annotation coverage, this is inadequate.

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 wasted words. It's front-loaded with the core functionality ('Get posts from a Threads user'), making it immediately clear. Every word earns its place, achieving optimal conciseness.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what 'posts' entail (e.g., content, metadata, media), how many are returned, or any behavioral traits. For a tool that likely involves network calls and data retrieval, more context is needed to guide the agent effectively.

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%, with the single parameter 'handle' documented as 'Threads username'. The description adds no additional parameter semantics beyond what the schema provides (e.g., format examples, validation rules). The baseline score of 3 is appropriate since 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 verb ('Get') and resource ('posts from a Threads user'), making the purpose immediately understandable. It distinguishes from siblings like 'get_threads_profile' which retrieves profile information rather than posts. However, it doesn't specify scope (e.g., recent posts, all posts) which prevents a perfect score.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites, limitations, or comparisons to sibling tools like 'get_threads_profile' for profile data or 'get_instagram_posts' for similar functionality on another platform. This leaves the agent with minimal context for tool selection.

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