get_accounts
Retrieve connected social media accounts from X (Twitter), Instagram, and Threads for managing posts and analytics.
Instructions
Get list of connected social media accounts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:197-223 (handler)Implements the 'get_accounts' tool by fetching connected social media accounts from the Sociona API via apiRequest('/accounts'), handling empty list, and formatting a response listing accounts by provider, handle, and status.private async getAccounts() { const { accounts } = await this.apiRequest('GET', '/accounts'); if (!accounts || accounts.length === 0) { return { content: [ { type: 'text', text: 'No social media accounts connected.', }, ], }; } const accountList = accounts .map((a: any) => `- ${a.provider}: ${a.handle} (${a.status})`) .join('\n'); return { content: [ { type: 'text', text: `Connected accounts:\n${accountList}`, }, ], }; }
- src/index.ts:86-89 (schema)Input schema for 'get_accounts' tool: an empty object (no required parameters).inputSchema: { type: 'object', properties: {}, },
- src/index.ts:83-90 (registration)Registration of the 'get_accounts' tool in the ListToolsRequestSchema handler, specifying name, description, and input schema.{ name: 'get_accounts', description: 'Get list of connected social media accounts', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:142-143 (registration)Routing in the CallToolRequestSchema switch statement that invokes getAccounts() for the 'get_accounts' tool.case 'get_accounts': return await this.getAccounts();