Mastodon Scout
by @patelhiren
Read-only Mastodon skill. Outputs human-readable timeline summaries or raw JSON.
clawhub install mastodon-scoutπ About This Skill
name: mastodon-scout description: Read-only Mastodon skill. Outputs human-readable timeline summaries or raw JSON. metadata: {"clawdhub":{"emoji":"π¦£"},"clawdis":{"envVars":[{"name":"MASTODON_TOKEN","required":true},{"name":"MASTODON_INSTANCE","required":false,"default":"https://mastodon.social"}]}}
Mastodon Scout
Purpose
Read-only Mastodon skill. Fetches data from the Mastodon API via a bundled Python script (scripts/mastodon_scout.py). Returns human-readable summaries by default, or raw JSON with --json.
Invocation Rules (MANDATORY)
python3 ./scripts/mastodon_scout.py [options]
Commands
| Command | What it fetches |
|---------|----------------|
| home | Authenticated user's home timeline |
| user-tweets | Authenticated user's own posts |
| mentions | Mentions of the authenticated user |
| search | Posts matching the query |
Options
--instance Mastodon instance base URL (default: $MASTODON_INSTANCE or https://mastodon.social)
--limit Number of items to return (default: $LIMIT or 20)
--json Output raw JSON instead of human-readable text
Environment Variables
MASTODON_TOKEN Required. OAuth bearer token.
MASTODON_INSTANCE Optional. Instance base URL (default: https://mastodon.social).
Examples
python3 ./scripts/mastodon_scout.py home
python3 ./scripts/mastodon_scout.py mentions --limit 10
python3 ./scripts/mastodon_scout.py search "golang"
python3 ./scripts/mastodon_scout.py home --json
python3 ./scripts/mastodon_scout.py home --instance https://fosstodon.org
Output Modes
Text Mode (Default)
The script formats each post as:[N] Display Name (@user@instance) Β·
β© π β
The agent MAY add a brief summary after the list.JSON Mode (--json)
Returns raw Mastodon API JSON. Return it verbatim β no interpretation.Error Handling
The script prints a human-readable error to stderr and exits non-zero:
| Condition | Message |
|-----------|---------|
| Token missing | Error: MASTODON_TOKEN is not set |
| 401 | Mastodon API error: 401 Unauthorized β check MASTODON_TOKEN |
| 403 | Mastodon API error: 403 Forbidden |
| 422 | Mastodon API error: 422 Unprocessable Entity |
| 429 | Mastodon API error: 429 Rate Limited β try again later |
Do not retry on error. Guide the user to Authentication Setup if the token is missing or invalid.
Examples That Trigger This Skill
mastodon-scout homeshow my mastodon timelinecheck mastodon mentionssearch mastodon for "golang"get my mastodon postsNotes
scripts/mastodon_scout.py uses stdlib only β no pip install requiredAuthentication Setup (Agent MAY Help)
EXCEPTION TO STRICT MODE: If the user needs help obtaining a token, the agent may provide guidance before executing the skill.
How to Obtain a Token:
Step 1: Access Development Settings
https://[instance-domain]/settings/applicationsStep 2: Create Application
mastodon-scout (or any name)
- Redirect URI: urn:ietf:wg:oauth:2.0:oob
- Scopes: CRITICAL β only select read (uncheck write, follow, push)Step 3: Get Access Token
Step 4: Set Environment Variable
export MASTODON_TOKEN="paste_token_here"
Step 5: Verify
python3 ./scripts/mastodon_scout.py home --limit 5
Common Mastodon Instances:
mastodon.social β General purpose (default)fosstodon.org β FOSS/tech communitymas.to β Tech focusedhachyderm.io β Tech/infosec communitySecurity Notes:
π‘ Examples
python3 ./scripts/mastodon_scout.py home
python3 ./scripts/mastodon_scout.py mentions --limit 10
python3 ./scripts/mastodon_scout.py search "golang"
python3 ./scripts/mastodon_scout.py home --json
python3 ./scripts/mastodon_scout.py home --instance https://fosstodon.org
βοΈ Configuration
--instance Mastodon instance base URL (default: $MASTODON_INSTANCE or https://mastodon.social)
--limit Number of items to return (default: $LIMIT or 20)
--json Output raw JSON instead of human-readable text
Environment Variables
MASTODON_TOKEN Required. OAuth bearer token.
MASTODON_INSTANCE Optional. Instance base URL (default: https://mastodon.social).
Examples
python3 ./scripts/mastodon_scout.py home
python3 ./scripts/mastodon_scout.py mentions --limit 10
python3 ./scripts/mastodon_scout.py search "golang"
python3 ./scripts/mastodon_scout.py home --json
python3 ./scripts/mastodon_scout.py home --instance https://fosstodon.org
π Tips & Best Practices
scripts/mastodon_scout.py uses stdlib only β no pip install required