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)}`);
        }
      }
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for disclosing behavioral traits. It only states the action without mentioning that the post becomes publicly visible, requires authentication, or has any side effects. There is no information about rate limits, error behavior, or the fact that it is a write operation.

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, clear sentence with no filler or redundancy. It is appropriately sized for the tool's simplicity and front-loads the core purpose.

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?

The tool is a write operation with no output schema and no annotations. The description is minimal and fails to include important context such as how to construct a reply (via replyTo), expected response, or any prerequisites. Given the availability of sibling tools like 'convert-url-to-uri' and 'get-post-thread', this description leaves gaps for an agent to correctly invoke the tool in all scenarios.

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% coverage with descriptions for both parameters ('text' and 'replyTo'). The description adds no additional meaning beyond the schema, but schema ambiguity is minimal. Baseline 3 is appropriate given full schema coverage.

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

Purpose5/5

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

The description clearly states the tool's function with a specific verb ('Create') and resource ('a new post on Bluesky'). This distinguishes it from sibling tools like 'repost' or 'like-post', which have different actions.

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?

No guidance is provided on when to use this tool versus alternatives. It does not mention that it should be used for original posts, or that to reply to an existing post, the replyTo parameter should be populated with a URI. There is no explicit context or exclusion.

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

Deploy Server

Other Tools

Related Tools