Skip to main content
Glama

get_posts

Retrieve recent social media posts from X, Instagram, and Threads via the Sociona API for monitoring and management purposes.

Instructions

Get recent posts published via the API

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of posts to retrieve (max 100)

Implementation Reference

  • The handler function that implements the logic for the 'get_posts' tool. It calls the API to retrieve recent posts with an optional limit, formats them into a list, and returns the response.
    private async getPosts(args: any) { const limit = args.limit || 50; const { posts } = await this.apiRequest('GET', `/posts?limit=${limit}`); if (!posts || posts.length === 0) { return { content: [ { type: 'text', text: 'No posts found.', }, ], }; } const postList = posts .map((p: any) => `- ${p.provider}: ${p.status} (${p.startedAt}) ${p.url ? `URL: ${p.url}` : ''}`) .join('\n'); return { content: [ { type: 'text', text: `Recent posts (last ${posts.length}):\n${postList}`, }, ], }; }
  • The input schema for the 'get_posts' tool, defining the optional 'limit' parameter.
    inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of posts to retrieve (max 100)', default: 50, minimum: 1, maximum: 100, }, }, },
  • src/index.ts:91-106 (registration)
    The tool registration in the ListTools response, including name, description, and input schema.
    { name: 'get_posts', description: 'Get recent posts published via the API', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Number of posts to retrieve (max 100)', default: 50, minimum: 1, maximum: 100, }, }, }, },
  • The switch case dispatcher that routes 'get_posts' tool calls to the getPosts handler method.
    case 'get_posts': return await this.getPosts(args);

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/fav-devs/sociona-mcp-server'

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