follow-user
Enables AI assistants to follow a specific user on Bluesky by providing the user's handle. Part of the Bluesky MCP Server for managing social interactions on the ATProtocol.
Instructions
Follow a user on Bluesky
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| handle | Yes | The handle of the user to follow |
Implementation Reference
- src/index.ts:687-706 (handler)The handler function that implements the 'follow-user' tool. It resolves the provided handle to a DID using agent.resolveHandle, then calls agent.follow(did) to perform the follow action, with proper error handling.if (!agent) { return mcpErrorResponse("Not logged in. Please check your environment variables."); } try { // Resolve the handle to a DID const resolveResponse = await agent.resolveHandle({ handle: cleanHandle(handle) }); if (!resolveResponse.success) { return mcpErrorResponse(`Failed to resolve handle: ${handle}`); } const did = resolveResponse.data.did; await agent.follow(did); return mcpSuccessResponse(`Successfully followed @${handle}`); } catch (error) { return mcpErrorResponse(`Error following user: ${error instanceof Error ? error.message : String(error)}`); } }
- src/index.ts:684-686 (schema)Input schema using Zod: requires a 'handle' parameter which is a string describing the user's handle (e.g., alice.bsky.social).handle: z.string().describe("The handle of the user to follow"), }, async ({ handle }) => {
- src/index.ts:681-707 (registration)The MCP server.tool registration for the 'follow-user' tool, including name, description, input schema, and handler reference."follow-user", "Follow a user on Bluesky", { handle: z.string().describe("The handle of the user to follow"), }, async ({ handle }) => { if (!agent) { return mcpErrorResponse("Not logged in. Please check your environment variables."); } try { // Resolve the handle to a DID const resolveResponse = await agent.resolveHandle({ handle: cleanHandle(handle) }); if (!resolveResponse.success) { return mcpErrorResponse(`Failed to resolve handle: ${handle}`); } const did = resolveResponse.data.did; await agent.follow(did); return mcpSuccessResponse(`Successfully followed @${handle}`); } catch (error) { return mcpErrorResponse(`Error following user: ${error instanceof Error ? error.message : String(error)}`); } } );