Skip to main content
Glama

get_posts

Retrieve posts from your Instagram account or Facebook page to manage content and analyze engagement.

Instructions

Get posts from your Instagram account or Facebook page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesPlatform to get posts from
limitNoNumber of posts to retrieve (default: 25)

Implementation Reference

  • Zod schema for validating input parameters of the get_posts tool: platform (instagram or facebook) and optional limit.
    const GetPostsSchema = z.object({
      platform: z.enum(['instagram', 'facebook']),
      limit: z.number().optional()
    });
  • src/index.ts:203-214 (registration)
    Tool registration in the list of available tools returned by ListToolsRequestHandler, including name, description, and input schema.
    {
      name: 'get_posts',
      description: 'Get posts from your Instagram account or Facebook page',
      inputSchema: {
        type: 'object',
        properties: {
          platform: { type: 'string', enum: ['instagram', 'facebook'], description: 'Platform to get posts from' },
          limit: { type: 'number', description: 'Number of posts to retrieve (default: 25)' }
        },
        required: ['platform']
      }
    },
  • Handler logic in the CallToolRequestHandler switch statement: parses input with schema, then calls platform-specific API functions getInstagramPosts or getFacebookPosts.
    case 'get_posts': {
      const params = GetPostsSchema.parse(args);
      if (params.platform === 'instagram') {
        result = await api.getInstagramPosts(params.limit);
      } else {
        result = await api.getFacebookPosts(params.limit);
      }
      break;
    }
  • Core implementation for fetching Instagram posts using Graph API /media endpoint.
    export async function getInstagramPosts(limit: number = 25): Promise<{ data: Post[] }> {
      const igAccountId = config.igAccountId || (await getMyInstagramProfile()).id;
    
      return makeApiCall({
        endpoint: `/${igAccountId}/media`,
        params: {
          fields: 'id,caption,media_type,media_url,thumbnail_url,permalink,timestamp,like_count,comments_count',
          limit
        }
      });
    }
  • Core implementation for fetching Facebook page posts using Graph API /feed endpoint.
    export async function getFacebookPosts(limit: number = 25): Promise<{ data: Post[] }> {
      return makeApiCall({
        endpoint: `/${config.fbPageId}/feed`,
        params: {
          fields: 'id,message,story,created_time,permalink_url,full_picture,attachments{media_type,url,title,description}',
          limit
        }
      });
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It doesn't disclose whether this is a read-only operation (implied by 'Get'), authentication requirements, rate limits, pagination behavior, or what format the posts are returned in. For a tool with no annotations, this leaves significant gaps in understanding how it 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, efficient sentence with zero wasted words. It's appropriately sized for a simple retrieval tool and gets straight to the point without unnecessary elaboration.

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 and no output schema, the description is incomplete. It doesn't explain what 'posts' means in this context (recent posts? all posts? specific types?), doesn't mention authentication requirements, and provides no information about return format or structure. For a social media API tool, this leaves too many questions unanswered.

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 already documents both parameters thoroughly. The description doesn't add any meaning beyond what the schema provides about platform selection or limit defaults. It doesn't explain the implications of choosing different platforms or how the limit parameter affects results.

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 the resource 'posts', specifying the sources as 'your Instagram account or Facebook page'. It distinguishes from siblings like get_instagram_post_details (specific post details) and get_conversations (messages), but doesn't explicitly differentiate from get_my_facebook_page or get_my_instagram_profile which retrieve profile/page info rather than posts.

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 on when to use this tool versus alternatives is provided. It doesn't mention when to choose get_posts over get_instagram_post_details for detailed post info, or when to use it versus get_my_facebook_page for page metadata. The description only states what it does, not when it's appropriate.

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/osborn1997/instagram-mcp-server'

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