Skip to main content
Glama
brianellin

Bluesky MCP Server

by brianellin

create-post

Generate and publish a post on Bluesky, including text content up to 300 characters, with an optional reply to an existing post.

Instructions

Create a new post on Bluesky

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
replyToNoOptional URI of post to reply to
textYesThe content of your post

Implementation Reference

  • src/index.ts:212-266 (registration)
    Registration of the 'create-post' MCP tool, including inline schema and handler function.
    server.tool(
      "create-post",
      "Create a new post on Bluesky",
      {
        text: z.string().max(300).describe("The content of your post"),
        replyTo: z.string().optional().describe("Optional URI of post to reply to"),
      },
      async ({ text, replyTo }) => {
        if (!agent) {
          return mcpErrorResponse("Not connected to Bluesky. Check your environment variables.");
        }
    
        try {
          const record: any = {
            text,
            createdAt: new Date().toISOString(),
          };
    
          let replyRef;
          if (replyTo) {
            // Handle reply format
            try {
              const parts = replyTo.split('/');
              const did = parts[2];
              const rkey = parts[parts.length - 1];
              const collection = parts[parts.length - 2] === 'app.bsky.feed.post' ? 'app.bsky.feed.post' : parts[parts.length - 2];
              
              // Resolve the CID of the post we're replying to
              const cidResponse = await agent.app.bsky.feed.getPostThread({ uri: replyTo });
              if (!cidResponse.success) {
                throw new Error('Could not get post information');
              }
              
              const threadPost = cidResponse.data.thread as any;
              const parentCid = threadPost.post.cid;
              
              // Add reply information to the record
              record.reply = {
                parent: { uri: replyTo, cid: parentCid },
                root: { uri: replyTo, cid: parentCid }
              };
    
            } catch (error) {
              return mcpErrorResponse(`Error parsing reply URI: ${error instanceof Error ? error.message : String(error)}`);
            }
          }
    
          const response = await agent.post(record);
          
          return mcpSuccessResponse(`Post created successfully! URI: ${response.uri}`);
        } catch (error) {
          return mcpErrorResponse(`Error creating post: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
  • Zod input schema defining parameters for the create-post tool: required 'text' (max 300 chars) and optional 'replyTo' URI.
    {
      text: z.string().max(300).describe("The content of your post"),
      replyTo: z.string().optional().describe("Optional URI of post to reply to"),
    },
  • Handler function that authenticates with agent, constructs post record with optional reply context (fetches CID), posts via agent.post(), and returns success/error MCP response.
      async ({ text, replyTo }) => {
        if (!agent) {
          return mcpErrorResponse("Not connected to Bluesky. Check your environment variables.");
        }
    
        try {
          const record: any = {
            text,
            createdAt: new Date().toISOString(),
          };
    
          let replyRef;
          if (replyTo) {
            // Handle reply format
            try {
              const parts = replyTo.split('/');
              const did = parts[2];
              const rkey = parts[parts.length - 1];
              const collection = parts[parts.length - 2] === 'app.bsky.feed.post' ? 'app.bsky.feed.post' : parts[parts.length - 2];
              
              // Resolve the CID of the post we're replying to
              const cidResponse = await agent.app.bsky.feed.getPostThread({ uri: replyTo });
              if (!cidResponse.success) {
                throw new Error('Could not get post information');
              }
              
              const threadPost = cidResponse.data.thread as any;
              const parentCid = threadPost.post.cid;
              
              // Add reply information to the record
              record.reply = {
                parent: { uri: replyTo, cid: parentCid },
                root: { uri: replyTo, cid: parentCid }
              };
    
            } catch (error) {
              return mcpErrorResponse(`Error parsing reply URI: ${error instanceof Error ? error.message : String(error)}`);
            }
          }
    
          const response = await agent.post(record);
          
          return mcpSuccessResponse(`Post created successfully! URI: ${response.uri}`);
        } catch (error) {
          return mcpErrorResponse(`Error creating post: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates a post but doesn't mention any behavioral traits such as authentication requirements, rate limits, whether the post is publicly visible, or what happens on success/failure. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any fluff or unnecessary details. It's appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a mutation operation creating social media content) and the lack of annotations and output schema, the description is insufficiently complete. It doesn't cover critical context like authentication needs, response format, error handling, or how it integrates with sibling tools (e.g., 'get-post-thread' for viewing created posts). This leaves significant gaps for an AI agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for both parameters ('text' as required content with max length, 'replyTo' as optional URI). The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without adding extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and target resource ('new post on Bluesky'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling tools like 'reply-to-post' or 'share-post' that might exist in other contexts, though among the actual siblings listed, it's distinct as the primary creation tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. For example, it doesn't mention whether to use this for original posts versus replying (though 'replyTo' parameter hints at replies), or how it differs from tools like 'like-post' or 'get-user-posts' in the sibling list. There's no explicit when/when-not or alternative tool recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/brianellin/bsky-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server