Skip to main content
Glama

get_keyword_search_posts

Retrieve social media posts matching specific keywords across platforms like Twitter, Reddit, and YouTube for search and analysis purposes.

Instructions

Get raw posts from a keyword search. Returns the actual social media posts matching the search query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
search_idYesKeyword search ID
platformNoFilter by platform (default: all)

Implementation Reference

  • The "get_keyword_search_posts" tool is defined and implemented directly within the registration block in src/tools/posts.ts. The handler is the inline async function passed as the fourth argument.
    server.tool(
      "get_keyword_search_posts",
      "Get raw posts from a keyword search. Returns the actual social media posts matching the search query.",
      {
        search_id: z.number().int().positive().describe("Keyword search ID"),
        platform: z
          .enum(["all", "twitter", "reddit", "bluesky", "youtube", "instagram", "facebook", "weibo", "linkedin"])
          .optional()
          .describe("Filter by platform (default: all)"),
      },
      async (params) => {
        try {
          const query = params.platform ? `?platform=${params.platform}` : "";
          const data = await apiGet(`/iq/keyword_search/${params.search_id}/posts_data${query}`);
          return { content: [{ type: "text", text: `${UNTRUSTED_CONTENT_NOTICE}\n\n${JSON.stringify(data, null, 2)}` }] };
        } catch (e) {
          return { content: [{ type: "text", text: String(e) }], isError: true };
        }
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool returns 'actual social media posts matching the search query', which implies read-only behavior but doesn't disclose critical details like pagination, rate limits, authentication needs, error conditions, or what 'raw posts' entails (e.g., format, fields). For a tool fetching social media data, this is a significant gap.

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?

The description is two concise sentences with zero waste. The first sentence states the purpose, and the second clarifies the return value. It's appropriately sized and front-loaded, though could be slightly more structured (e.g., explicitly mentioning parameters).

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 no annotations, no output schema, and a tool that fetches social media data (potentially complex), the description is incomplete. It lacks details on return format (e.g., JSON structure, fields), pagination, error handling, and behavioral constraints. The agent has insufficient context to use this tool effectively beyond basic invocation.

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%, so the schema fully documents both parameters (search_id, platform). The description adds no parameter-specific semantics beyond implying the search_id corresponds to a keyword search. Baseline 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 tool's purpose: 'Get raw posts from a keyword search' specifies the verb (get) and resource (raw posts from keyword search). It distinguishes from siblings like 'get_keyword_search' (likely metadata) and 'get_user_search_posts' (user-based), though not explicitly. However, it doesn't fully differentiate from 'keyword_search' (which might create searches).

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a search_id from another tool), exclusions, or comparisons to siblings like 'keyword_search' or 'get_user_search_posts'. The agent must infer usage from context alone.

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/rolliinc/rolli-mcp'

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