Skip to main content
Glama

list_posts

Filter by platform, status, and date to retrieve social media posts. Access all post states including drafts, scheduled, published, and failed.

Instructions

List social media posts with optional filters for platform, status, and date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number (0-based)
limitNoPosts per page (max 50)
platformsNoFilter by platforms
statusesNoFilter by post statuses
fromNoStart date filter (ISO 8601, e.g. 2025-01-01T00:00:00.000Z)
toNoEnd date filter (ISO 8601, e.g. 2025-01-31T23:59:59.999Z)

Implementation Reference

  • Registers the 'list_posts' tool using server.tool() with the name 'list_posts', description, Zod schema for input params (page, limit, platforms, statuses, from, to), and handler function.
    server.tool(
      'list_posts',
      'List social media posts with optional filters for platform, status, and date range',
      {
        page: z.number().int().min(0).default(0).describe('Page number (0-based)'),
        limit: z
          .number()
          .int()
          .min(1)
          .max(50)
          .default(20)
          .describe('Posts per page (max 50)'),
        platforms: z
          .array(z.enum(PLATFORMS))
          .optional()
          .describe('Filter by platforms'),
        statuses: z
          .array(z.enum(STATUSES))
          .optional()
          .describe('Filter by post statuses'),
        from: z
          .string()
          .optional()
          .describe('Start date filter (ISO 8601, e.g. 2025-01-01T00:00:00.000Z)'),
        to: z
          .string()
          .optional()
          .describe('End date filter (ISO 8601, e.g. 2025-01-31T23:59:59.999Z)'),
      },
      async (input) => {
        const data = await client.get<PaginatedPosts>('/social-posts', {
          page: String(input.page),
          limit: String(input.limit),
          platforms: input.platforms?.join(','),
          statuses: input.statuses?.join(','),
          from: input.from,
          to: input.to,
        });
    
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • Handler function for list_posts: makes an HTTP GET request to '/social-posts' via the PostFastClient, passing query parameters (page, limit, platforms, statuses, from, to), and returns the paginated posts as JSON string content.
    async (input) => {
      const data = await client.get<PaginatedPosts>('/social-posts', {
        page: String(input.page),
        limit: String(input.limit),
        platforms: input.platforms?.join(','),
        statuses: input.statuses?.join(','),
        from: input.from,
        to: input.to,
      });
    
      return {
        content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
      };
    },
  • Zod input schema for list_posts defining page (int, min 0, default 0), limit (int, 1-50, default 20), platforms (optional array of enum PLATFORMS), statuses (optional array of enum STATUSES), from (optional ISO 8601 date string), to (optional ISO 8601 date string).
    {
      page: z.number().int().min(0).default(0).describe('Page number (0-based)'),
      limit: z
        .number()
        .int()
        .min(1)
        .max(50)
        .default(20)
        .describe('Posts per page (max 50)'),
      platforms: z
        .array(z.enum(PLATFORMS))
        .optional()
        .describe('Filter by platforms'),
      statuses: z
        .array(z.enum(STATUSES))
        .optional()
        .describe('Filter by post statuses'),
      from: z
        .string()
        .optional()
        .describe('Start date filter (ISO 8601, e.g. 2025-01-01T00:00:00.000Z)'),
      to: z
        .string()
        .optional()
        .describe('End date filter (ISO 8601, e.g. 2025-01-31T23:59:59.999Z)'),
    },
  • src/index.ts:6-6 (registration)
    Import of registerPostTools from the posts module where list_posts is registered.
    import { registerPostTools } from './tools/posts.js';
  • PaginatedPosts type used as the return type for the list_posts handler's API response.
    export interface PaginatedPosts {
      data: SocialPost[];
      totalCount: number;
      pageInfo: { page: number; hasNextPage: boolean; perPage: number };
    }
Behavior3/5

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

With no annotations, the description carries the burden. It indicates a read operation via 'list,' but does not disclose pagination behavior, sorting, authentication needs, or any side effects. Minimal but not misleading.

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?

One efficient sentence with no wasted words. Clear and direct, front-loading the core action and key options.

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

Completeness3/5

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

Lacks output schema and does not describe return values or pagination behavior. For a list operation, this is a noticeable gap, though the parameters hint at pagination.

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 parameters. The description only restates filter categories without adding new semantics, meeting baseline but not exceeding.

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

Purpose5/5

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

The description clearly states the action (list) and resource (social media posts), and mentions key filters (platform, status, date range). It effectively distinguishes from sibling tools like create_posts or delete_post.

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 explicit guidance on when to use this tool versus alternatives (e.g., get_post_analytics for counts). The description only implies usage for simple listing but lacks exclusions or context.

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/peturgeorgievv-factory/postfast-mcp'

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