Skip to main content
Glama
brianellin

Bluesky MCP Server

by brianellin

like-post

Like a specific post on Bluesky using its URI. Part of the Bluesky MCP Server, enabling AI assistants to interact with social features on the ATProtocol platform.

Instructions

Like a post on Bluesky

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYesThe URI of the post to like

Implementation Reference

  • Handler function that fetches the post thread to get the CID and then calls agent.like() to like the post.
    async ({ uri }) => {
      if (!agent) {
        return mcpErrorResponse("Not logged in. Please check your environment variables.");
      }
    
      try {
        // First, we need to get the CID of the post
        const parts = uri.split('/');
        const repo = parts[2]; // The DID
        const collection = parts[4]; // Usually app.bsky.feed.post
        const rkey = parts[5]; // The record key
        
        const response = await agent.app.bsky.feed.getPostThread({ uri });
        
        if (!response.success || response.data.thread.$type !== 'app.bsky.feed.defs#threadViewPost') {
          return mcpErrorResponse("Failed to get post information.");
        }
        
        // Type assertion to tell TypeScript this is a post
        const threadPost = response.data.thread as any;
        const post = threadPost.post;
        const cid = post.cid;
        
        await agent.like(uri, cid);
        
        return mcpSuccessResponse("Post liked successfully!");
      } catch (error) {
        return mcpErrorResponse(`Error liking post: ${error instanceof Error ? error.message : String(error)}`);
      }
    }
  • Input schema defining the 'uri' parameter as a string with description.
      uri: z.string().describe("The URI of the post to like"),
    },
  • src/index.ts:642-678 (registration)
    Registration of the 'like-post' tool using server.tool(), including name, description, schema, and handler.
    server.tool(
      "like-post",
      "Like a post on Bluesky",
      {
        uri: z.string().describe("The URI of the post to like"),
      },
      async ({ uri }) => {
        if (!agent) {
          return mcpErrorResponse("Not logged in. Please check your environment variables.");
        }
    
        try {
          // First, we need to get the CID of the post
          const parts = uri.split('/');
          const repo = parts[2]; // The DID
          const collection = parts[4]; // Usually app.bsky.feed.post
          const rkey = parts[5]; // The record key
          
          const response = await agent.app.bsky.feed.getPostThread({ uri });
          
          if (!response.success || response.data.thread.$type !== 'app.bsky.feed.defs#threadViewPost') {
            return mcpErrorResponse("Failed to get post information.");
          }
          
          // Type assertion to tell TypeScript this is a post
          const threadPost = response.data.thread as any;
          const post = threadPost.post;
          const cid = post.cid;
          
          await agent.like(uri, cid);
          
          return mcpSuccessResponse("Post liked successfully!");
        } catch (error) {
          return mcpErrorResponse(`Error liking post: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations, the description must fully disclose behavioral implications. It states only the action ('Like a post') without mentioning side effects, idempotency, permissions, or return behavior. For a mutation tool, this is a significant gap.

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 five-word sentence, front-loaded and free of any filler. Every word earns its place, making it maximally concise.

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

Completeness3/5

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

The tool is simple with one parameter and no output schema, so minimal description is acceptable. However, it does not explain return values, failure modes, or whether the like is reversible, leaving some ambiguity for a complete invocation.

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?

Schema description coverage is 100% and the sole parameter 'uri' is already described in the schema as 'The URI of the post to like'. The tool description adds no additional meaning or syntax details, so the baseline of 3 applies.

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 'Like a post on Bluesky' uses a specific verb and resource, clearly distinguishing this tool from siblings like 'repost' and 'create-post'. It fully conveys the tool's purpose.

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 like 'repost' or 'create-post'. There is no mention of prerequisites, context, or exclusions, leaving usage entirely to inference.

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