# Bluesky

Source: https://docs.autessa.com/docs/tools/bluesky

> Tool types for drafting, publishing, and measuring Bluesky posts through a Bluesky connector.

# Bluesky

Draft Bluesky posts into a reviewable AutessaDB table, publish approved drafts to the connected account over the AT Protocol, and read back per-post engagement.

Every tool on this page requires a Bluesky connector (see
[Connectors](/docs/guide/connectors.md)); pass its ID as `connectorId`. Posts
live as rows in an AutessaDB table the connector provisions: drafts start at
`status = DRAFT`, and publishing creates an `app.bsky.feed.post` record on
the account, flips the row to `PUBLISHED`, and stores the post's AT URI
(`at://did:plc:.../app.bsky.feed.post/...`) for later stats lookups.

## Create a draft **TOOL** `BLUESKY_CREATE_DRAFT`

Inserts a new draft row with `status = DRAFT` — nothing is posted to Bluesky
yet. `postContent` is capped at 300 characters, and the optional `mediaUrl`
image is stored on the row and only uploaded (as an image embed) at publish
time. Returns the new `recordId` for the update, publish, and stats tools.

### Example

```json title="Tool config"
{
  "toolType": "BLUESKY_CREATE_DRAFT",
  "connectorId": "V1StGXR8Z5",
  "postContent": "@@{POST_CONTENT}",
  "mediaUrl": "@@{IMAGE_URL}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `postContent` (string) — Max 300 characters
- `mediaUrl` (string · optional) — Optional - URL of image to attach

## Update a draft **TOOL** `BLUESKY_UPDATE_DRAFT`

Edits an existing draft row in place; `postContent` (still max 300
characters) and `mediaUrl` are both optional and only the provided fields
change. This edits the AutessaDB row only — it has no effect on a post that
has already been published.

### Example

```json title="Tool config"
{
  "toolType": "BLUESKY_UPDATE_DRAFT",
  "connectorId": "V1StGXR8Z5",
  "recordId": 42,
  "postContent": "@@{REVISED_CONTENT}"
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `recordId` (integer) — AutessaDB record ID of the draft to update
- `postContent` (string · optional) — Optional - new content (max 300 characters)
- `mediaUrl` (string · optional) — Optional - new media URL

## Publish a post **TOOL** `BLUESKY_PUBLISH_POST`

Reads the draft row, uploads its image as a blob if a media URL is set, and
creates the post on the connected account via the AT Protocol. The row must
still be in `DRAFT` status — republishing fails with `ALREADY_PUBLISHED`. On
success the row is updated to `status = PUBLISHED` and the post's AT URI is
stored on the row.

### Example

```json title="Tool config"
{
  "toolType": "BLUESKY_PUBLISH_POST",
  "connectorId": "V1StGXR8Z5",
  "recordId": 42
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `recordId` (integer) — AutessaDB record ID of the draft to publish

## Get post stats **TOOL** `BLUESKY_GET_POST_STATS`

Looks up the stored `post_uri` on a published row and fetches live counts
from Bluesky: likes, reposts, and replies, along with the post's current
text. Only works for rows that have been published (or synced) and therefore
carry an AT URI.

### Example

```json title="Tool config"
{
  "toolType": "BLUESKY_GET_POST_STATS",
  "connectorId": "V1StGXR8Z5",
  "recordId": 42
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `recordId` (integer) — AutessaDB record ID to get post_uri from

## Get all posts **TOOL** `BLUESKY_GET_ALL_POSTS`

Lists rows from the connector's posts table — drafts and published posts
together by default, or filtered with `status` (`DRAFT`, `PUBLISHED`,
`SCHEDULED`). `pageSize` defaults to 50 and caps at 100. Reads the AutessaDB
table, so results include anything a human has added or edited there too.

### Example

```json title="Tool config"
{
  "toolType": "BLUESKY_GET_ALL_POSTS",
  "connectorId": "V1StGXR8Z5",
  "status": "DRAFT",
  "pageSize": 50
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `status` (string · optional) — Optional filter: DRAFT, PUBLISHED, SCHEDULED
- `pageSize` (integer · optional) — Optional, default 50, max 100

## Get post by ID **TOOL** `BLUESKY_GET_POST_BY_ID`

Fetches a single row from the posts table by its AutessaDB `rowId`,
returning the post's content, status, media URL, and stored AT URI. Use it
to inspect one specific draft or published post without paging through the
full list.

### Example

```json title="Tool config"
{
  "toolType": "BLUESKY_GET_POST_BY_ID",
  "connectorId": "V1StGXR8Z5",
  "rowId": 42
}
```

> This tool type requires a connected external account. Pass the connector's ID as `connectorId` in the tool configuration.

**Configuration fields**

- `connectorId` (string (ID)) — Required string (ID) value. References a connector by ID.
- `rowId` (integer) — AutessaDB record ID to fetch

## Related

- [Tool Types overview](/docs/tools.md)
- [Tools guide](/docs/guide/agentic/tools.md)
- [Connectors guide](/docs/guide/connectors.md)
- [Twitter / X tool types](/docs/tools/twitter.md)
- [Threads tool types](/docs/tools/threads.md)
- [LinkedIn tool types](/docs/tools/linkedin.md)

