mastodonlisted
Install: claude install-skill AceDataCloud/Skills
Call the **Mastodon REST API** with `curl + jq`. Two connector credentials are
injected: `$MASTODON_BASE_URL` (the instance, e.g. `https://mastodon.social`)
and `$MASTODON_ACCESS_TOKEN`. Every request sends the header
`Authorization: Bearer $MASTODON_ACCESS_TOKEN`.
Errors come back as JSON `{"error":"<message>"}` — show it verbatim. `401`
(`"The access token is invalid"`) means the token is wrong/revoked → the user
must re-connect the Mastodon connector. Posting needs the token to have the
`write` (or `write:statuses`) scope.
**Always confirm the token + account first** (also gives the account `id` you
need to list your own toots):
```bash
curl -sS "$MASTODON_BASE_URL/api/v1/accounts/verify_credentials" \
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
| jq '{id, username, acct, display_name, followers: .followers_count, statuses: .statuses_count}'
```
## Post a toot
**Confirm with the user before posting publicly.** Default `visibility` to
`unlisted` unless they say post publicly; use `public` only on request.
```bash
STATUS_TEXT="Hello fediverse 👋 #introductions"
curl -sS -X POST "$MASTODON_BASE_URL/api/v1/statuses" \
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
--data-urlencode "status=$STATUS_TEXT" \
--data-urlencode "visibility=unlisted" \
--data-urlencode "language=en" \
| jq '{id, url, visibility, created_at}'
```
- `visibility` is one of `public`, `unlisted`, `private`, `direct`.
- Optional params: