# adapt_content

Source: https://heyeveryone.ai/docs/mcp/adapt_content

> Turn a content item's original draft (with its sources and the workspace's voice) into channel-native drafts within each channel's limits. Each target is `{ channelAccountId, format? }`; limits come from the channel's capabilities (`limits` overrides them); format defaults to the existing post's, else the platform's text post. A draft or ready post gets a new version, a missing one a new draft; one awaiting confirmation, scheduled, publishing, published or with the post kit is `skipped` (cancel or reschedule it first). `mode: "propose"` writes nothing: each target gets a suggestion (`proposals`) a person accepts or rejects. Never publishes. Charged per target written or proposed; skipped ones are free; a rejected suggestion isn't refunded.

Turn a content item's original draft (with its sources and the workspace's voice) into channel-native drafts within each channel's limits. Each target is `{ channelAccountId, format? }`; limits come from the channel's capabilities (`limits` overrides them); format defaults to the existing post's, else the platform's text post. A draft or ready post gets a new version, a missing one a new draft; one awaiting confirmation, scheduled, publishing, published or with the post kit is `skipped` (cancel or reschedule it first). `mode: "propose"` writes nothing: each target gets a suggestion (`proposals`) a person accepts or rejects. Never publishes. Charged per target written or proposed; skipped ones are free; a rejected suggestion isn't refunded.

Uses heyeveryone AI and costs credits: 2 credits per target channel. Tell the person before calling it.

## Access and cost

- Kind: mutation
- Scope: workspace
- Actors: member, agent
- Credits: 2 credits per target channel.
- Requires confirmation: false
- Accepts idempotency key: true

## Input schema

```json
{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "pieceId": {
      "format": "uuid",
      "type": "string"
    },
    "targets": {
      "items": {
        "properties": {
          "channelAccountId": {
            "format": "uuid",
            "type": "string"
          },
          "format": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "type": "string"
          },
          "platform": {
            "enum": [
              "x",
              "linkedin",
              "threads",
              "bluesky",
              "instagram",
              "facebook",
              "tiktok",
              "youtube",
              "sandbox"
            ],
            "type": "string"
          },
          "limits": {
            "properties": {
              "maxCharsPerSegment": {
                "minimum": 1,
                "type": "integer"
              },
              "maxSegments": {
                "default": 1,
                "minimum": 1,
                "type": "integer"
              },
              "maxMediaPerSegment": {
                "default": 0,
                "minimum": 0,
                "type": "integer"
              },
              "supportsThread": {
                "default": false,
                "type": "boolean"
              },
              "requiredFields": {
                "default": [],
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "maxCharsPerSegment"
            ],
            "type": "object"
          }
        },
        "required": [
          "channelAccountId"
        ],
        "type": "object"
      },
      "maxItems": 20,
      "minItems": 1,
      "type": "array"
    },
    "instructions": {
      "maxLength": 2000,
      "type": "string"
    },
    "mode": {
      "default": "write",
      "enum": [
        "write",
        "propose"
      ],
      "type": "string"
    },
    "idempotencyKey": {
      "maxLength": 200,
      "minLength": 1,
      "type": "string"
    }
  },
  "required": [
    "workspaceId",
    "pieceId",
    "targets"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "additionalProperties": false,
  "properties": {
    "posts": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "workspaceId": {
            "format": "uuid",
            "type": "string"
          },
          "pieceId": {
            "format": "uuid",
            "type": "string"
          },
          "channelAccountId": {
            "format": "uuid",
            "type": "string"
          },
          "format": {
            "pattern": "^[a-z][a-z0-9_]*$",
            "type": "string"
          },
          "segments": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "text": {
                  "type": "string"
                },
                "media": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "mediaAssetId": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "altText": {
                        "maxLength": 2000,
                        "type": "string"
                      }
                    },
                    "required": [
                      "mediaAssetId"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": [
                "text",
                "media"
              ],
              "type": "object"
            },
            "minItems": 1,
            "type": "array"
          },
          "settings": {
            "type": "object"
          },
          "state": {
            "enum": [
              "draft",
              "ready",
              "awaiting_confirmation",
              "scheduled",
              "publishing",
              "published",
              "failed_retrying",
              "needs_attention",
              "failed",
              "manual",
              "removed"
            ],
            "type": "string"
          },
          "scheduledAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "scheduleSource": {
            "anyOf": [
              {
                "enum": [
                  "manual",
                  "queue",
                  "recurrence",
                  "evergreen"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "isSkipped": {
            "type": "boolean"
          },
          "version": {
            "minimum": 1,
            "type": "integer"
          },
          "followsOriginal": {
            "type": "boolean"
          },
          "followIssue": {
            "type": [
              "string",
              "null"
            ]
          },
          "requestedByAgentClientId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmedByAccountId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "fix": {
                    "type": "string"
                  }
                },
                "required": [
                  "code",
                  "message"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "publishedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "permalink": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdByAccountId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdByAgentClientId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspaceId",
          "pieceId",
          "channelAccountId",
          "format",
          "segments",
          "settings",
          "state",
          "scheduledAt",
          "scheduleSource",
          "isSkipped",
          "version",
          "followsOriginal",
          "followIssue",
          "requestedByAgentClientId",
          "confirmedByAccountId",
          "confirmedAt",
          "lastError",
          "publishedAt",
          "permalink",
          "createdByAccountId",
          "createdByAgentClientId",
          "createdAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "proposals": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "workspaceId": {
            "format": "uuid",
            "type": "string"
          },
          "pieceId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "target": {
            "enum": [
              "master",
              "post",
              "piece"
            ],
            "type": "string"
          },
          "postId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "channelAccountId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "format": {
            "anyOf": [
              {
                "pattern": "^[a-z][a-z0-9_]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "baseVersion": {
            "anyOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "content": {
            "additionalProperties": false,
            "properties": {
              "text": {
                "type": "string"
              },
              "segments": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "media": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "mediaAssetId": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "altText": {
                            "maxLength": 2000,
                            "type": "string"
                          }
                        },
                        "required": [
                          "mediaAssetId"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "text",
                    "media"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "title": {
                "type": "string"
              },
              "plannedFor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "plannedTime": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "campaignLabels": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "targets": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "channelAccountId": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "format": {
                      "pattern": "^[a-z][a-z0-9_]*$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "channelAccountId"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "sources": {
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "sourceId": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "mediaAssetId": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "passage": {
                      "additionalProperties": false,
                      "properties": {
                        "start": {
                          "minimum": 0,
                          "type": "number"
                        },
                        "end": {
                          "minimum": 0,
                          "type": "number"
                        },
                        "unit": {
                          "enum": [
                            "chars",
                            "seconds"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "start",
                        "end"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "origin": {
            "enum": [
              "adapt_piece",
              "rewrite_text",
              "agent",
              "member",
              "ai_agent"
            ],
            "type": "string"
          },
          "aiRunId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditsSpent": {
            "minimum": 0,
            "type": "integer"
          },
          "status": {
            "enum": [
              "pending",
              "accepted",
              "rejected"
            ],
            "type": "string"
          },
          "stale": {
            "type": "boolean"
          },
          "staleReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "currentVersion": {
            "anyOf": [
              {
                "minimum": 1,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "author": {
            "additionalProperties": false,
            "properties": {
              "kind": {
                "enum": [
                  "member",
                  "guest",
                  "agent",
                  "system"
                ],
                "type": "string"
              },
              "accountId": {
                "anyOf": [
                  {
                    "format": "uuid",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "agentClientId": {
                "anyOf": [
                  {
                    "format": "uuid",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "guestId": {
                "anyOf": [
                  {
                    "format": "uuid",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "accountId",
              "agentClientId",
              "guestId",
              "name"
            ],
            "type": "object"
          },
          "decidedBy": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "enum": [
                      "member",
                      "guest",
                      "agent",
                      "system"
                    ],
                    "type": "string"
                  },
                  "accountId": {
                    "anyOf": [
                      {
                        "format": "uuid",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "agentClientId": {
                    "anyOf": [
                      {
                        "format": "uuid",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "guestId": {
                    "anyOf": [
                      {
                        "format": "uuid",
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "accountId",
                  "agentClientId",
                  "guestId",
                  "name"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "decidedAt": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "decisionNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "resultVersion": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "resultPieceId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspaceId",
          "pieceId",
          "target",
          "postId",
          "channelAccountId",
          "format",
          "baseVersion",
          "content",
          "origin",
          "aiRunId",
          "note",
          "creditsSpent",
          "status",
          "stale",
          "staleReason",
          "currentVersion",
          "author",
          "decidedBy",
          "decidedAt",
          "decisionNote",
          "resultVersion",
          "resultPieceId",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "skipped": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "channelAccountId": {
            "format": "uuid",
            "type": "string"
          },
          "postId": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "channelAccountId",
          "postId",
          "reason"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "creditsSpent": {
      "type": "integer"
    },
    "url": {
      "description": "The content page in heyeveryone. Give it to the person so they can open the draft.",
      "type": "string"
    }
  },
  "required": [
    "posts",
    "proposals",
    "skipped",
    "creditsSpent",
    "url"
  ],
  "type": "object"
}
```

## Errors

```json
[
  "piece_not_found",
  "ai_generation_failed",
  "insufficient_credits",
  "plan_limit_reached",
  "idempotency_conflict"
]
```

## Annotations

```json
{
  "destructiveHint": false,
  "idempotentHint": false,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Adapt content to its channels"
}
```
