Skip to main content
Glama

list_accounts

List all social media accounts connected to your workspace for centralized oversight.

Instructions

List all social media accounts connected to the workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The 'list_accounts' tool handler. Defines the tool with no input params, calls GET /social-media/my-social-accounts on the PostFast API, and returns the list of connected social media accounts as JSON.
    server.tool(
      'list_accounts',
      'List all social media accounts connected to the workspace',
      {},
      async () => {
        const data = await client.get<SocialAccount[]>(
          '/social-media/my-social-accounts',
        );
    
        return {
          content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
        };
      },
    );
  • The registerAccountTools function that registers 'list_accounts' (and other account tools) on the MCP server instance.
    export function registerAccountTools(
      server: McpServer,
      client: PostFastClient,
    ) {
      server.tool(
        'list_accounts',
        'List all social media accounts connected to the workspace',
        {},
        async () => {
          const data = await client.get<SocialAccount[]>(
            '/social-media/my-social-accounts',
          );
    
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
          };
        },
      );
    
      server.tool(
        'list_pinterest_boards',
        'List Pinterest boards for a connected Pinterest account',
        {
          socialMediaId: z
            .string()
            .uuid()
            .describe('Pinterest account ID (from list_accounts)'),
        },
        async (input) => {
          const data = await client.get<PinterestBoard[]>(
            `/social-media/${input.socialMediaId}/pinterest-boards`,
          );
    
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
          };
        },
      );
    
      server.tool(
        'list_youtube_playlists',
        'List YouTube playlists for a connected YouTube account',
        {
          socialMediaId: z
            .string()
            .uuid()
            .describe('YouTube account ID (from list_accounts)'),
        },
        async (input) => {
          const data = await client.get<YouTubePlaylist[]>(
            `/social-media/${input.socialMediaId}/youtube-playlists`,
          );
    
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
          };
        },
      );
    
      server.tool(
        'list_gbp_locations',
        'List Google Business Profile locations for a connected GBP account',
        {
          socialMediaId: z
            .string()
            .uuid()
            .describe('GBP account ID (from list_accounts)'),
        },
        async (input) => {
          const data = await client.get<GbpLocation[]>(
            `/social-media/${input.socialMediaId}/gbp-locations`,
          );
    
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
          };
        },
      );
    
      server.tool(
        'generate_connect_link',
        'Generate a shareable link for external clients to connect their social accounts to the workspace',
        {
          expiryDays: z
            .number()
            .int()
            .min(1)
            .max(30)
            .default(7)
            .describe('Link expiry in days (1-30, default 7)'),
          sendEmail: z
            .boolean()
            .default(false)
            .describe('Send the link via email'),
          email: z
            .string()
            .email()
            .optional()
            .describe('Recipient email (required if sendEmail is true)'),
        },
        async (input) => {
          const data = await client.post<{ connectUrl: string }>(
            '/social-media/connect-link',
            {
              expiryDays: input.expiryDays,
              sendEmail: input.sendEmail,
              email: input.email,
            },
          );
    
          return {
            content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }],
          };
        },
      );
    }
  • src/index.ts:7-7 (registration)
    Import of registerAccountTools from the accounts module.
    import { registerAccountTools } from './tools/accounts.js';
  • src/index.ts:18-18 (registration)
    Registration call that wires registerAccountTools into the server at startup.
    registerAccountTools(server, client);
Behavior4/5

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

With no annotations, the description accurately states a read-only operation. It does not detail authentication needs or rate limits, but for a simple list tool, the transparency is adequate.

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, front-loaded sentence with no extraneous words. Every part is necessary and clear.

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?

The description fails to specify the return format or fields of the listed accounts, and there is no output schema. Information on pagination or sorting is also absent, leaving the agent uncertain about the tool's output.

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

Parameters4/5

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

There are no parameters, so schema coverage is 100%. The description adds no parameter info, which is appropriate since none exist. Baseline 4 for zero-parameter tools.

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 tool lists all social media accounts connected to the workspace, using a specific verb and resource. It is distinct from sibling tools like list_posts or list_gbp_locations.

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

Usage Guidelines3/5

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

No explicit when-to-use or when-not-to-use guidance is provided. The description implies the tool is for retrieving all accounts, but there is no mention of alternatives or prerequisites.

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