Skip to main content
Glama
brianellin

Bluesky MCP Server

by brianellin

get-profile

Retrieve a Bluesky user's profile by entering their handle, enabling access to key information via the Bluesky MCP Server for direct integration with AI assistants.

Instructions

Get a user's profile from Bluesky

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handleYesThe handle of the user (e.g., alice.bsky.social)

Implementation Reference

  • The handler function for the 'get-profile' tool. It fetches the user's profile from Bluesky using AtpAgent.getProfile after cleaning the handle input, formats the profile information into a readable text summary, and returns it as an MCP success response. Handles errors appropriately.
      async ({ handle }) => {
        if (!agent) {
          return mcpErrorResponse("Not logged in. Please check your environment variables.");
        }
    
        try {
          const response = await agent.getProfile({ actor: cleanHandle(handle) });
          
          if (!response.success) {
            return mcpErrorResponse(`Failed to get profile for ${handle}.`);
          }
    
          const profile = response.data;
          
          let profileText = `Profile for ${profile.displayName || handle} (@${profile.handle})
    DID: ${profile.did}
    ${profile.description ? `Bio: ${profile.description}` : ''}
    Followers: ${profile.followersCount || 0}
    Following: ${profile.followsCount || 0}
    Posts: ${profile.postsCount || 0}
    ${profile.labels?.length ? `Labels: ${profile.labels.map((l: any) => l.val).join(', ')}` : ''}`;
    
          return mcpSuccessResponse(profileText);
        } catch (error) {
          return mcpErrorResponse(`Error fetching profile: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
  • src/index.ts:268-301 (registration)
    The server.tool call that registers the 'get-profile' tool on the MCP server, including the tool name, description, input schema, and references the handler function.
    server.tool(
      "get-profile",
      "Get a user's profile from Bluesky",
      {
        handle: z.string().describe("The handle of the user (e.g., alice.bsky.social)"),
      },
      async ({ handle }) => {
        if (!agent) {
          return mcpErrorResponse("Not logged in. Please check your environment variables.");
        }
    
        try {
          const response = await agent.getProfile({ actor: cleanHandle(handle) });
          
          if (!response.success) {
            return mcpErrorResponse(`Failed to get profile for ${handle}.`);
          }
    
          const profile = response.data;
          
          let profileText = `Profile for ${profile.displayName || handle} (@${profile.handle})
    DID: ${profile.did}
    ${profile.description ? `Bio: ${profile.description}` : ''}
    Followers: ${profile.followersCount || 0}
    Following: ${profile.followsCount || 0}
    Posts: ${profile.postsCount || 0}
    ${profile.labels?.length ? `Labels: ${profile.labels.map((l: any) => l.val).join(', ')}` : ''}`;
    
          return mcpSuccessResponse(profileText);
        } catch (error) {
          return mcpErrorResponse(`Error fetching profile: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
  • Zod input schema for the 'get-profile' tool, defining a required 'handle' parameter as a string with description.
    {
      handle: z.string().describe("The handle of the user (e.g., alice.bsky.social)"),
  • The cleanHandle utility function used in the get-profile handler to normalize the input handle by removing leading '@' if present and preserving DIDs.
    export function cleanHandle(input: string): string {
      if (!input) return '';
      
      // If it's a DID, return it as is
      if (input.startsWith('did:')) {
        return input;
      }
      
      // If it has a leading @, remove it
      if (input.startsWith('@')) {
        return input.substring(1);
      }
      
      // Otherwise return as is
      return input;
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states it retrieves a profile but doesn't mention what data is returned (e.g., display name, bio, follower count), error conditions (e.g., invalid handle), rate limits, or authentication requirements. This leaves significant gaps for an agent to understand the tool's behavior.

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 unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 lack of annotations and output schema, the description is incomplete. It doesn't explain what a 'profile' entails (e.g., structured data fields), potential response formats, or error handling. For a tool with no structured behavioral hints, this minimal description leaves too much unspecified for reliable agent use.

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%, with the single parameter 'handle' clearly documented in the schema as 'The handle of the user (e.g., alice.bsky.social)'. The description adds no additional parameter information beyond what the schema provides, so it meets the baseline of 3 for adequate but not additive coverage.

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 ('Get') and resource ('a user's profile from Bluesky'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling tools like 'search-people' or 'get-my-handle-and-did', which might also retrieve user information in different contexts.

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. It doesn't mention prerequisites (like needing a valid handle), when not to use it (e.g., for searching vs. direct lookup), or how it differs from sibling tools like 'search-people' or 'get-my-handle-and-did'.

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