Skip to main content
Glama
brianellin

Bluesky MCP Server

by brianellin

get-trends

Discover current trending topics on Bluesky by fetching a customizable number of results, optionally including suggested topics for comprehensive insights.

Instructions

Get current trending topics on Bluesky

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeSuggestedNoWhether to include suggested topics in addition to trending topics
limitNoNumber of trending topics to fetch (1-50)

Implementation Reference

  • The handler function for the 'get-trends' tool. It fetches current trending topics from Bluesky using the unspecced API endpoint, formats them with post counts, start times, and feed links. Optionally includes suggested topics. Handles errors and returns formatted MCP response.
        if (!agent) {
          return mcpErrorResponse("Not connected to Bluesky. Check your environment variables.");
        }
    
        const currentAgent = agent; // Assign to non-null variable to satisfy TypeScript
        
        try {
          // Call the unspecced API endpoint for trending topics
          const response = await currentAgent.api.app.bsky.unspecced.getTrendingTopics({
            limit: Math.min(50, limit) // API accepts up to 50 per call
          });
          
          if (!response.success) {
            return mcpErrorResponse("Failed to fetch trending topics.");
          }
    
          const { topics, suggested } = response.data;
          
          if (!topics || topics.length === 0) {
            return mcpSuccessResponse("No trending topics found at this time.");
          }
    
          // Format trending topics
          const formattedTopics = topics.map((topic: any, index: number) => {
            const startTime = new Date(topic.startTime).toLocaleString();
            return `#${index + 1}: ${topic.topic}
    Post Count: ${topic.postCount} posts
    Started Trending: ${startTime}
    Feed Link: https://bsky.app${topic.link}
    ---`;
          }).join("\n\n");
    
          // Format suggested topics if requested
          let suggestedContent = "";
          if (includeSuggested && suggested && suggested.length > 0) {
            const formattedSuggested = suggested.map((topic: any, index: number) => {
              return `#${index + 1}: ${topic.topic}
    Feed Link: https://bsky.app${topic.link}
    ---`;
            }).join("\n\n");
            
            suggestedContent = `\n\n## Suggested Topics for Exploration\n\n${formattedSuggested}`;
          }
    
          return mcpSuccessResponse(`## Current Trending Topics on Bluesky\n\n${formattedTopics}${suggestedContent}`);
        } catch (error) {
          return mcpErrorResponse(`Error fetching trending topics: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
  • The input schema for the 'get-trends' tool using Zod validation. Parameters: limit (number, 1-50, default 10) for number of topics, includeSuggested (boolean, default false).
      limit: z.number().min(1).max(50).default(10).describe("Number of trending topics to fetch (1-50)"),
      includeSuggested: z.boolean().default(false).describe("Whether to include suggested topics in addition to trending topics"),
    },
    async ({ limit, includeSuggested }) => {
  • src/index.ts:584-641 (registration)
    The registration of the 'get-trends' tool on the MCP server, including name, description, input schema, and handler reference.
      "get-trends",
      "Get current trending topics on Bluesky",
      {
        limit: z.number().min(1).max(50).default(10).describe("Number of trending topics to fetch (1-50)"),
        includeSuggested: z.boolean().default(false).describe("Whether to include suggested topics in addition to trending topics"),
      },
      async ({ limit, includeSuggested }) => {
        if (!agent) {
          return mcpErrorResponse("Not connected to Bluesky. Check your environment variables.");
        }
    
        const currentAgent = agent; // Assign to non-null variable to satisfy TypeScript
        
        try {
          // Call the unspecced API endpoint for trending topics
          const response = await currentAgent.api.app.bsky.unspecced.getTrendingTopics({
            limit: Math.min(50, limit) // API accepts up to 50 per call
          });
          
          if (!response.success) {
            return mcpErrorResponse("Failed to fetch trending topics.");
          }
    
          const { topics, suggested } = response.data;
          
          if (!topics || topics.length === 0) {
            return mcpSuccessResponse("No trending topics found at this time.");
          }
    
          // Format trending topics
          const formattedTopics = topics.map((topic: any, index: number) => {
            const startTime = new Date(topic.startTime).toLocaleString();
            return `#${index + 1}: ${topic.topic}
    Post Count: ${topic.postCount} posts
    Started Trending: ${startTime}
    Feed Link: https://bsky.app${topic.link}
    ---`;
          }).join("\n\n");
    
          // Format suggested topics if requested
          let suggestedContent = "";
          if (includeSuggested && suggested && suggested.length > 0) {
            const formattedSuggested = suggested.map((topic: any, index: number) => {
              return `#${index + 1}: ${topic.topic}
    Feed Link: https://bsky.app${topic.link}
    ---`;
            }).join("\n\n");
            
            suggestedContent = `\n\n## Suggested Topics for Exploration\n\n${formattedSuggested}`;
          }
    
          return mcpSuccessResponse(`## Current Trending Topics on Bluesky\n\n${formattedTopics}${suggestedContent}`);
        } catch (error) {
          return mcpErrorResponse(`Error fetching trending topics: ${error instanceof Error ? error.message : String(error)}`);
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but only states the basic function. It doesn't mention whether this is a read-only operation (implied but not explicit), rate limits, authentication needs, freshness of data, or what the return format looks like (no output schema exists). Significant gaps remain for a tool that fetches dynamic content.

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 front-loads the core purpose with zero wasted words. Every element ('Get', 'current trending topics', 'on Bluesky') earns its place by specifying action, resource, and context.

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 moderate complexity (fetching dynamic trending data), lack of annotations, and absence of an output schema, the description is insufficiently complete. It doesn't explain what 'trending topics' entails (e.g., hashtags, keywords, posts), how results are structured, or any behavioral constraints, leaving the agent with significant unknowns.

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 both parameters ('includeSuggested', 'limit') well-documented in the schema itself. The description adds no additional parameter context beyond what the schema provides, so it meets the baseline for high schema coverage without compensating 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 ('Get') and resource ('current trending topics on Bluesky'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential siblings like 'search-posts' or 'get-feed-posts' that might also surface trending content, missing full sibling distinction.

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 like 'search-posts' for topic discovery or 'get-timeline-posts' for personalized content. It lacks explicit when/when-not instructions or named alternatives, leaving usage context implied at best.

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