Skip to main content
Glama

get_social_media_accounts

Retrieve connected social media accounts from platforms like Facebook, Instagram, Twitter, LinkedIn, and TikTok. Filter by specific networks to manage and access account information.

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, makes GET request to '/api/v1/service/social-media/get-accounts' with optional network filter, returns formatted JSON response with accounts or error.
    .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) } ] }; } })
  • Tool definition including name, description, category, version, and input schema for optional 'network' parameter with enum of supported platforms.
    export const getSocialMediaAccountsTool: ToolDefinition = createTool() .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)
    Registers all socialMediaTools (including getSocialMediaAccountsTool) into the ToolRegistry during server initialization in registerDefaultTools() method.
    for (const tool of socialMediaTools) { this.toolRegistry.registerTool(tool); }
  • Exports the tool as part of the socialMediaTools array for higher-level 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