Skip to main content
Glama
Beyond-Network-AI

Beyond MCP Server

get-user-content

Retrieve user-generated content from social platforms like Farcaster, Twitter, and Telegram by specifying the user ID and platform. Control the number of posts returned with a customizable limit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of posts to return
platformYesSocial platform (farcaster, twitter, telegram)
userIdYesUser ID or username on the platform

Implementation Reference

  • The core handler function for the 'get-user-content' tool. It retrieves the appropriate provider based on the platform, fetches the user's content, formats it using formatUserContent, and returns the result or an error.
    async ({ platform, userId, limit = 10 }) => {
      try {
        const provider = providerRegistry.getProviderForPlatform(platform);
        
        if (!provider) {
          return {
            content: [{ type: "text", text: `Provider for platform '${platform}' not found or not enabled` }],
            isError: true
          };
        }
        
        const content = await provider.getUserContent(userId, { limit });
        
        return {
          content: [{ 
            type: "text", 
            text: formatUserContent(content, platform) 
          }]
        };
      } catch (error) {
        return {
          content: [{ 
            type: "text", 
            text: `Error fetching ${platform} content for user '${userId}': ${error instanceof Error ? error.message : String(error)}` 
          }],
          isError: true
        };
      }
    }
  • Zod schema defining the input parameters for the tool: platform (required string), userId (required string), limit (optional number).
    {
      platform: z.string().describe("Social platform (farcaster, twitter, telegram)"),
      userId: z.string().describe("User ID or username on the platform"),
      limit: z.number().optional().describe("Maximum number of posts to return")
    },
  • Direct registration of the 'get-user-content' tool on the MCP server using server.tool(), including schema and handler.
    server.tool(
      "get-user-content",
      {
        platform: z.string().describe("Social platform (farcaster, twitter, telegram)"),
        userId: z.string().describe("User ID or username on the platform"),
        limit: z.number().optional().describe("Maximum number of posts to return")
      },
      async ({ platform, userId, limit = 10 }) => {
        try {
          const provider = providerRegistry.getProviderForPlatform(platform);
          
          if (!provider) {
            return {
              content: [{ type: "text", text: `Provider for platform '${platform}' not found or not enabled` }],
              isError: true
            };
          }
          
          const content = await provider.getUserContent(userId, { limit });
          
          return {
            content: [{ 
              type: "text", 
              text: formatUserContent(content, platform) 
            }]
          };
        } catch (error) {
          return {
            content: [{ 
              type: "text", 
              text: `Error fetching ${platform} content for user '${userId}': ${error instanceof Error ? error.message : String(error)}` 
            }],
            isError: true
          };
        }
      }
    );
  • Top-level registration call within createMcpServer() that invokes registerContentTools to set up the 'get-user-content' tool and others.
    registerContentTools(server, providerRegistry);
  • Helper utility function used by the handler to format the retrieved user content into a readable text string for the tool response.
    function formatUserContent(content: SocialContent[], platform: string): string {
      if (content.length === 0) {
        return `No content available for this user on ${platform}.`;
      }
      
      const formattedContent = content.map((item, index) => {
        return `[${index + 1}] ${item.text}
        - Posted: ${new Date(item.createdAt).toLocaleString()}
        - Engagement: ${item.likes || 0} likes, ${item.reposts || 0} reposts, ${item.replies || 0} replies
        - ID: ${item.id}`;
      }).join('\n\n');
      
      return `Recent Content on ${platform}:\n\n${formattedContent}`;
    }
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

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

Related 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/Beyond-Network-AI/beyond-mcp-server'

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