> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socialsyncs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools Reference

> Complete reference for all SocialSyncs MCP tools

## integrationList

List all connected social media accounts (channels) for your organization.

**Parameters:**

| Field   | Type   | Required | Description                                                                                             |
| ------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- |
| `group` | string | No       | Group (customer) ID from `groupList`. When provided, only channels belonging to that group are returned |

**Returns:**

| Field      | Type   | Description                                                                                                         |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| `id`       | string | Integration ID (use this when scheduling posts)                                                                     |
| `name`     | string | Display name of the account                                                                                         |
| `picture`  | string | Profile picture URL                                                                                                 |
| `platform` | string | Platform identifier (e.g., `x`, `linkedin`, `facebook`)                                                             |
| `customer` | object | The group (customer) this channel belongs to, as `{ id, name }` — omitted if the channel is not assigned to a group |

***

## groupList

List all groups (customers) for your organization. Use a group's `id` with `integrationList` to filter channels down to a single group.

**Parameters:** None

**Returns:**

| Field  | Type   | Description                                                |
| ------ | ------ | ---------------------------------------------------------- |
| `id`   | string | Group (customer) ID (pass to `integrationList` as `group`) |
| `name` | string | Group (customer) display name                              |

***

## integrationSchema

Get the posting rules, character limits, required settings, and available helper tools for a specific platform. Call this before scheduling a post to understand what the platform expects.

**Parameters:**

| Field       | Type    | Required | Description                                                      |
| ----------- | ------- | -------- | ---------------------------------------------------------------- |
| `isPremium` | boolean | Yes      | Whether the user has a premium subscription                      |
| `platform`  | string  | Yes      | Platform identifier (e.g., `x`, `linkedin`, `reddit`, `discord`) |

**Returns:**

| Field       | Type   | Description                                        |
| ----------- | ------ | -------------------------------------------------- |
| `rules`     | string | Platform-specific posting rules and best practices |
| `maxLength` | number | Maximum character length for posts                 |
| `settings`  | object | JSON schema of required settings for this platform |
| `tools`     | array  | Platform-specific helper tools (see `triggerTool`) |

The `tools` array contains helper functions specific to the platform. For example, Discord returns a tool to list available channels, Reddit returns a tool to search for subreddits, and LinkedIn Page returns a tool to list pages.

Each tool in the array has:

| Field         | Type   | Description                            |
| ------------- | ------ | -------------------------------------- |
| `methodName`  | string | Function name to pass to `triggerTool` |
| `description` | string | What the tool does                     |
| `dataSchema`  | array  | Parameters the tool accepts            |

***

## triggerTool

Execute a platform-specific helper function. These are discovered through `integrationSchema` and are used to fetch dynamic data like channel lists, subreddit suggestions, or page IDs.

**Parameters:**

| Field           | Type   | Required | Description                                      |
| --------------- | ------ | -------- | ------------------------------------------------ |
| `integrationId` | string | Yes      | The integration ID from `integrationList`        |
| `methodName`    | string | Yes      | The function name from `integrationSchema` tools |
| `dataSchema`    | array  | Yes      | Key-value pairs of parameters for the function   |

Each item in `dataSchema`:

| Field   | Type   | Description     |
| ------- | ------ | --------------- |
| `key`   | string | Parameter name  |
| `value` | string | Parameter value |

**Example use cases:**

* Get the list of Discord channels for a server
* Search for Reddit subreddits
* List LinkedIn pages you manage
* Get Facebook page options
* Search Instagram audio (`audioSearch`) to attach to a Reel — only on Facebook Business-linked Instagram channels

***

## schedulePostTool

Schedule, draft, or immediately publish posts to social media platforms. This is the main tool for creating content.

**Parameters:**

| Field        | Type  | Required | Description              |
| ------------ | ----- | -------- | ------------------------ |
| `socialPost` | array | Yes      | Array of posts to create |

Each item in `socialPost`:

| Field              | Type    | Required | Description                                         |
| ------------------ | ------- | -------- | --------------------------------------------------- |
| `integrationId`    | string  | Yes      | Integration ID from `integrationList`               |
| `isPremium`        | boolean | Yes      | Whether the user has premium                        |
| `date`             | string  | Yes      | UTC datetime (e.g., `2025-01-15T10:00:00.000Z`)     |
| `shortLink`        | boolean | Yes      | Whether to shorten links in the post                |
| `type`             | string  | Yes      | `draft`, `schedule`, or `now`                       |
| `postsAndComments` | array   | Yes      | The post content and optional comments              |
| `settings`         | array   | Yes      | Platform-specific settings from `integrationSchema` |

Each item in `postsAndComments`:

| Field         | Type   | Description                               |
| ------------- | ------ | ----------------------------------------- |
| `content`     | string | HTML content (see formatting rules below) |
| `attachments` | array  | Array of image/media URLs                 |

Each item in `settings`:

| Field   | Type   | Description                                           |
| ------- | ------ | ----------------------------------------------------- |
| `key`   | string | Setting name                                          |
| `value` | any    | Setting value (prefer IDs over labels when available) |

### Content Formatting

Content must be HTML with these allowed tags only:

| Tag                    | Usage           |
| ---------------------- | --------------- |
| `<p>`                  | Wrap each line  |
| `<h1>`, `<h2>`, `<h3>` | Headings        |
| `<strong>`             | Bold text       |
| `<u>`                  | Underlined text |
| `<ul>`, `<li>`         | Lists           |

<Warning>
  You cannot combine `<u>` and `<strong>` in the same element. Each line of text must be wrapped in `<p>` tags.
</Warning>

### Posts vs Comments

The `postsAndComments` array behavior depends on the platform:

* **Thread-based platforms** (X, Threads, Bluesky): Each array item becomes a separate post in a thread
* **Comment-based platforms** (LinkedIn, Facebook): First item is the post, remaining items are comments

### Multiple Posts

To schedule multiple posts (e.g., 20 posts across different days), add multiple items to the `socialPost` array — each with its own `date` and `integrationId`.

**Returns:**

| Field         | Type   | Description                      |
| ------------- | ------ | -------------------------------- |
| `postId`      | string | The created post ID              |
| `integration` | string | The integration it was posted to |

If validation fails, returns `{ errors: string }` with details about what went wrong (e.g., content exceeds character limit).

***

## generateImageTool

Generate an AI image to use as a post attachment.

**Parameters:**

| Field    | Type   | Required | Description                          |
| -------- | ------ | -------- | ------------------------------------ |
| `prompt` | string | Yes      | Description of the image to generate |

**Returns:**

| Field  | Type   | Description                |
| ------ | ------ | -------------------------- |
| `id`   | string | Media ID                   |
| `path` | string | URL of the generated image |

Use the returned `path` in the `attachments` array when scheduling a post.

***

## automationList

List all automation workflows for your organization, optionally filtered by integration.

**Parameters:**

| Field           | Type   | Required | Description                     |
| --------------- | ------ | -------- | ------------------------------- |
| `integrationId` | string | No       | Filter by a specific channel ID |

**Returns:** Array of automation objects with `id`, `name`, `integrationId`, `triggerType`, `active`, `successCount`, `failureCount`.

***

## automationCreate

Create a new automation workflow.

**Parameters:**

| Field      | Type   | Required | Description                                                                                           |
| ---------- | ------ | -------- | ----------------------------------------------------------------------------------------------------- |
| `workflow` | object | Yes      | Full workflow object — same shape as the [Create Automation](/public-api/automations/create) API body |

**Returns:** The created automation object including its assigned `id`.

***

## automationUpdate

Update an existing automation workflow by ID.

**Parameters:**

| Field      | Type   | Required | Description                      |
| ---------- | ------ | -------- | -------------------------------- |
| `id`       | string | Yes      | Automation ID to update          |
| `workflow` | object | Yes      | Full replacement workflow object |

**Returns:** The updated automation object.

***

## automationToggleActive

Enable or disable an automation without changing its configuration.

**Parameters:**

| Field    | Type    | Required | Description                          |
| -------- | ------- | -------- | ------------------------------------ |
| `id`     | string  | Yes      | Automation ID                        |
| `active` | boolean | Yes      | `true` to enable, `false` to disable |

**Returns:** The updated automation object.

***

## automationDelete

Soft-delete an automation workflow. Execution logs are preserved.

**Parameters:**

| Field | Type   | Required | Description             |
| ----- | ------ | -------- | ----------------------- |
| `id`  | string | Yes      | Automation ID to delete |

**Returns:** Confirmation of deletion.

<Warning>
  This is a destructive action. The automation will immediately stop firing on incoming events.
</Warning>

***

## automationLogs

Retrieve paginated execution logs for an automation.

**Parameters:**

| Field    | Type   | Required | Description                                   |
| -------- | ------ | -------- | --------------------------------------------- |
| `id`     | string | Yes      | Automation ID                                 |
| `cursor` | string | No       | Pagination cursor from a previous call        |
| `limit`  | number | No       | Number of logs to return (1–200, default: 50) |

**Returns:**

| Field        | Type           | Description                                                                                  |
| ------------ | -------------- | -------------------------------------------------------------------------------------------- |
| `items`      | array          | Log entries with `state` (`SUCCESS`/`FAILED`), `matchedKeyword`, `errorMessage`, `createdAt` |
| `nextCursor` | string \| null | Pass to next call for the next page                                                          |

***

## automationTest

Dry-run the keyword matcher for an automation against a synthetic event. **No actions are executed** — no DM is sent, no comment is replied to, no log is written.

**Parameters:**

| Field            | Type   | Required | Description                                                              |
| ---------------- | ------ | -------- | ------------------------------------------------------------------------ |
| `id`             | string | Yes      | Automation ID to test                                                    |
| `sampleText`     | string | Yes      | Sample text to match against (e.g. a comment or DM body, max 2000 chars) |
| `samplePostId`   | string | No       | Sample post ID for post-scoped trigger testing                           |
| `sampleUsername` | string | No       | Sample sender username                                                   |

**Returns:** The match decision — whether the automation would have fired and which keyword matched.
