a tool to help your Letta AI agents navigate bluesky
1# Letta Agent Tools
2
3This directory contains Python tools for the Letta agent to interact with Bluesky.
4
5## Directory Structure
6
7```
8tools/
9├── bluesky/ # Bluesky-specific tools
10│ ├── *.py # Your tool files go here
11│ └── example_tool.py # Sample showing expected format
12└── README.md # This file
13```
14
15## Adding Your Existing Tools
16
171. **Copy your Python tool files** into the `tools/bluesky/` directory
182. **Ensure each file contains ONE tool function** as the main export
193. **Tool naming convention**: The filename should match the function name
20 - Example: `create_bluesky_post.py` contains `def create_bluesky_post(...)`
21
22## Required Tools for Bluesky
23
24Based on your operational guide, these tools are referenced:
25
26- `create_bluesky_post` - Creates posts or replies on Bluesky
27- `like_bluesky_post` - Likes a specific post
28- `repost_bluesky_post` - Reposts content to followers
29- `quote_bluesky_post` - Quotes a post with commentary
30- `update_bluesky_connection` - Follow/unfollow/block/mute operations
31- `fetch_bluesky_posts` - Retrieves posts from feeds
32- `get_bluesky_user_info` - Gets user profile information
33- `update_bluesky_profile` - Updates the agent's profile
34- `ignore_notification` - (May be handled by Letta core, not custom)
35
36## Tool Format Requirements
37
38Each Python tool file must:
39
401. **Use Google-style docstrings** with:
41 - Brief description
42 - `Args:` section documenting all parameters
43 - `Returns:` section describing the return value
44 - Optional `Example:` section
45
462. **Include type annotations** for all parameters and return values
47
483. **Access environment variables** for credentials:
49 ```python
50 import os
51 username = os.getenv("BSKY_USERNAME")
52 password = os.getenv("BSKY_APP_PASSWORD")
53 service_url = os.getenv("BSKY_SERVICE_URL")
54 ```
55
564. **Return meaningful results** (strings, JSON, or structured data)
57
58See `tools/bluesky/example_tool.py` for a complete example.
59
60## How It Works
61
62When you run `deno task prep-agent`, the script will:
63
641. Check which tools are already attached to your agent
652. Search for tools in Letta's global tool registry
663. For missing tools, read the `.py` file from `tools/bluesky/`
674. Create the tool in Letta
685. Attach the tool to your agent
69
70## After Adding Tools
71
72Once you've copied your tool files into `tools/bluesky/`:
73
74```bash
75deno task prep-agent
76```
77
78This will automatically create and attach all tools to your agent.
79
80## Updating Tools
81
82If you modify a tool:
83
841. Update the `.py` file in `tools/bluesky/`
852. Delete the old tool from Letta (via UI or API)
863. Run `deno task prep-agent` to recreate it
87
88Alternatively, use Letta's `client.tools.modify()` API to update existing tools.