Skip to main content
Glama

get_social_media_accounts

Retrieve connected social media accounts from multiple platforms to manage posting and content creation through a unified interface.

Instructions

Retrieve all connected social media accounts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoFilter by specific social media platform

Implementation Reference

  • The handler function that executes the tool logic: checks for apiClient, builds query params with optional network filter, calls the API, and returns formatted success/error response.
    .handler(async (params, apiClient) => {
      if (!apiClient) {
        throw new AppError(
          ErrorType.TOOL_ERROR,
          'API client not available - server configuration error'
        );
      }
    
      try {
        const queryParams: Record<string, any> = {};
    
        if (params.network) queryParams.network = params.network;
    
        const response = await apiClient.get('/api/v1/service/social-media/get-accounts', queryParams);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: true,
                accounts: response.data.accounts || response.data,
                total: response.data.total || (Array.isArray(response.data) ? response.data.length : 1),
                filters: {
                  network: params.network || 'all'
                }
              }, null, 2)
            }
          ]
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                success: false,
                error: `Failed to retrieve social media accounts: ${errorMessage}`
              }, null, 2)
            }
          ]
        };
      }
  • Input schema definition: tool name, description, category, version, and optional 'network' parameter with allowed platforms.
    .name('get_social_media_accounts')
    .description('Retrieve all connected social media accounts')
    .category('social-media')
    .version('1.0.0')
    .optionalString('network', 'Filter by specific social media platform', {
      enum: ['facebook', 'instagram', 'twitter', 'linkedin', 'tiktok', 'youtube', 'pinterest', 'threads', 'google', 'bluesky', 'tiktokBusiness']
    })
  • src/server.ts:129-131 (registration)
    Registration loop that adds all tools from socialMediaTools (including get_social_media_accounts) to the central ToolRegistry during server setup.
    for (const tool of socialMediaTools) {
      this.toolRegistry.registerTool(tool);
    }
  • Export of the socialMediaTools array that bundles the getSocialMediaAccountsTool for registration.
    export const socialMediaTools: ToolDefinition[] = [
      getSocialMediaAccountsTool,
      createSocialMediaPostTool

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/celeryhq/simplified-mcp-server'

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