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
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Filter 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); }
- src/tools/implementations/social-media-tools.ts:359-361 (registration)Export of the socialMediaTools array that bundles the getSocialMediaAccountsTool for registration.export const socialMediaTools: ToolDefinition[] = [ getSocialMediaAccountsTool, createSocialMediaPostTool