@acedatacloud/skills 2026.703.9 → 2026.703.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/mastodon/SKILL.md +103 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acedatacloud/skills",
|
|
3
|
-
"version": "2026.703.
|
|
3
|
+
"version": "2026.703.10",
|
|
4
4
|
"description": "Agent Skills for AceDataCloud AI services — music, image, video generation, LLM chat, web search. Compatible with Claude Code, GitHub Copilot, Gemini CLI, OpenAI Codex, and 30+ AI coding agents.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mastodon
|
|
3
|
+
description: Publish, delete and read your own posts (toots) on any Mastodon instance via the Mastodon REST API. Use when the user wants to post a toot to their Mastodon / fediverse account, cross-post an article as a short dev-focused post, delete a toot, or list their own recent posts with engagement stats (boosts, favourites, replies).
|
|
4
|
+
when_to_use: |
|
|
5
|
+
Trigger when the user wants to publish a status/toot to their Mastodon
|
|
6
|
+
account, delete one, or review their own recent posts and engagement.
|
|
7
|
+
Mastodon is federated: the connector stores the instance base URL plus a
|
|
8
|
+
personal access token, so every call targets the user's own instance.
|
|
9
|
+
Confirm visibility (public/unlisted) before posting publicly.
|
|
10
|
+
connections: [mastodon]
|
|
11
|
+
allowed_tools: [Bash]
|
|
12
|
+
license: Apache-2.0
|
|
13
|
+
metadata:
|
|
14
|
+
author: acedatacloud
|
|
15
|
+
version: "1.0"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Call the **Mastodon REST API** with `curl + jq`. Two connector credentials are
|
|
19
|
+
injected: `$MASTODON_BASE_URL` (the instance, e.g. `https://mastodon.social`)
|
|
20
|
+
and `$MASTODON_ACCESS_TOKEN`. Every request sends the header
|
|
21
|
+
`Authorization: Bearer $MASTODON_ACCESS_TOKEN`.
|
|
22
|
+
|
|
23
|
+
Errors come back as JSON `{"error":"<message>"}` — show it verbatim. `401`
|
|
24
|
+
(`"The access token is invalid"`) means the token is wrong/revoked → the user
|
|
25
|
+
must re-connect the Mastodon connector. Posting needs the token to have the
|
|
26
|
+
`write` (or `write:statuses`) scope.
|
|
27
|
+
|
|
28
|
+
**Always confirm the token + account first** (also gives the account `id` you
|
|
29
|
+
need to list your own toots):
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
curl -sS "$MASTODON_BASE_URL/api/v1/accounts/verify_credentials" \
|
|
33
|
+
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
|
|
34
|
+
| jq '{id, username, acct, display_name, followers: .followers_count, statuses: .statuses_count}'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Post a toot
|
|
38
|
+
|
|
39
|
+
**Confirm with the user before posting publicly.** Default `visibility` to
|
|
40
|
+
`unlisted` unless they say post publicly; use `public` only on request.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
STATUS_TEXT="Hello fediverse 👋 #introductions"
|
|
44
|
+
curl -sS -X POST "$MASTODON_BASE_URL/api/v1/statuses" \
|
|
45
|
+
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
|
|
46
|
+
-H "Idempotency-Key: $(uuidgen)" \
|
|
47
|
+
--data-urlencode "status=$STATUS_TEXT" \
|
|
48
|
+
--data-urlencode "visibility=unlisted" \
|
|
49
|
+
--data-urlencode "language=en" \
|
|
50
|
+
| jq '{id, url, visibility, created_at}'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- `visibility` is one of `public`, `unlisted`, `private`, `direct`.
|
|
54
|
+
- Optional params: `spoiler_text` (content warning), `in_reply_to_id` (reply),
|
|
55
|
+
`sensitive=true`, `language` (ISO 639-1).
|
|
56
|
+
- `Idempotency-Key` (any unique string; `uuidgen` here) prevents duplicate
|
|
57
|
+
posts if the request is retried within ~1h. Use `--data-urlencode` so
|
|
58
|
+
hashtags, emoji and newlines in the text are encoded correctly.
|
|
59
|
+
- Default post length is 500 chars (instance-configurable); longer text →
|
|
60
|
+
`422 {"error":"Validation failed: Text ..."}`.
|
|
61
|
+
|
|
62
|
+
## List my recent toots + engagement
|
|
63
|
+
|
|
64
|
+
Use the `id` from `verify_credentials`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
ACCT_ID="14715" # from verify_credentials
|
|
68
|
+
curl -sS "$MASTODON_BASE_URL/api/v1/accounts/$ACCT_ID/statuses?limit=20&exclude_replies=true&exclude_reblogs=true" \
|
|
69
|
+
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
|
|
70
|
+
| jq '.[] | {id, url, boosts: .reblogs_count, favs: .favourites_count, replies: .replies_count, created_at}'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`limit` max 40. Other filters: `only_media`, `pinned`, `tagged=<hashtag>`.
|
|
74
|
+
|
|
75
|
+
## Delete a toot
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
curl -sS -X DELETE "$MASTODON_BASE_URL/api/v1/statuses/STATUS_ID" \
|
|
79
|
+
-H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" | jq '{id, deleted: true}'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Deleting returns the status with its source `text` so you can delete-and-redraft.
|
|
83
|
+
`404 {"error":"Record not found"}` = not yours or already gone.
|
|
84
|
+
|
|
85
|
+
## Attaching media (optional)
|
|
86
|
+
|
|
87
|
+
Upload each image/video via `POST $MASTODON_BASE_URL/api/v2/media`
|
|
88
|
+
(`multipart/form-data`, field `file`) to get a media id, then pass the ids as
|
|
89
|
+
`media_ids[]` when posting the status. See the docs for the full media contract:
|
|
90
|
+
https://docs.joinmastodon.org/methods/media/
|
|
91
|
+
|
|
92
|
+
## Gotchas
|
|
93
|
+
|
|
94
|
+
- **Federated:** the API only ever targets `$MASTODON_BASE_URL` (the user's own
|
|
95
|
+
instance). There is no global endpoint — a token from instance A won't work
|
|
96
|
+
on instance B.
|
|
97
|
+
- **Scopes:** reading needs `read` (or `read:accounts`/`read:statuses`);
|
|
98
|
+
posting/deleting needs `write` (or `write:statuses`). A `403`
|
|
99
|
+
(`"This action is outside the authorized scopes"`) means the token lacks a scope.
|
|
100
|
+
- **Rate limits:** Mastodon rate-limits per token; space out bulk posts or you'll
|
|
101
|
+
get `429`.
|
|
102
|
+
- `verify_credentials` returns HTML in fields like `note`; the plaintext source
|
|
103
|
+
lives under the `source` object.
|