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

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 provided, the description must disclose behavioral context. It only says 'Get current trending topics' without noting whether the tool is read-only, whether authentication is required, what the response format looks like, or any rate-limit considerations. This is minimal behavioral disclosure beyond the basic verb.

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

Conciseness4/5

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

The description is a single, concise sentence that conveys the core purpose without waste. However, it is extremely terse, bordering on under-specification for a tool with two parameters and no annotations.

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?

For a simple query tool, the description plus complete parameter schema provide a basic understanding, but the lack of an output schema and any behavioral notes leaves some gaps. The description does not explain what 'trending topics' includes or how includeSuggested modifies the result.

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 fully describes both parameters (limit, includeSuggested) with ranges and defaults, so the description does not need to add parameter details. However, the description also does not add any extra meaning or context about how these parameters affect results.

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 action ('Get'), the resource ('current trending topics'), and the platform ('Bluesky'). It distinguishes from sibling tools like get-timeline-posts and search-posts by specifying trends specifically.

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 or when to prefer an alternative. It does not mention any distinguishing use cases, exclusions, or relationships to sibling tools like search-posts or get-feed-posts.

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