Skip to main content
Glama
Beyond-Network-AI

Beyond MCP Server

search-bulk-channels

Search for multiple channels simultaneously on social platforms like Farcaster, with options for query limits and pagination, enabling efficient data retrieval.

Instructions

Search for multiple channels on a social platform in parallel

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNoCursor for pagination
limitNoMaximum number of results to return per query
platformYesThe platform to search on (e.g., 'farcaster')
queriesYesArray of search queries

Implementation Reference

  • The handler function that implements the core logic of the 'search-bulk-channels' tool. It fetches the appropriate provider, validates support for bulk search, executes the search, formats the results from multiple queries, and returns structured content or handles errors.
      try {
        const provider = providerRegistry.getProviderForPlatform(platform);
        
        if (!provider) {
          throw new Error(`Provider for platform '${platform}' not found`);
        }
    
        // Check if the provider supports bulk channel search
        if (!provider.searchBulkChannels) {
          throw new Error(`Bulk channel search is not supported for platform '${platform}'`);
        }
        
        const results = await provider.searchBulkChannels(queries, {
          limit,
          cursor
        });
        
        // Format the results
        let response = `Search Results for ${queries.length} queries:\n\n`;
        
        for (const [query, result] of Object.entries(results)) {
          response += `Results for "${query}":\n`;
          if (result.channels.length === 0) {
            response += 'No channels found.\n';
          } else {
            const formattedChannels = result.channels.map(channel => 
              `Channel: ${channel.name}\n` +
              `Description: ${channel.description || 'No description'}\n` +
              `Followers: ${channel.followerCount}\n` +
              `Created: ${channel.createdAt}\n` +
              `URL: ${channel.parentUrl || 'N/A'}\n`
            ).join('\n');
            response += formattedChannels + '\n';
          }
          if (result.nextCursor) {
            response += `Use the cursor "${result.nextCursor}" to fetch more results for this query.\n`;
          }
          response += '\n';
        }
        
        return {
          content: [{ type: "text", text: response }],
          isError: false
        };
      } catch (error) {
        console.error(`Error in search-bulk-channels tool:`, error);
        return {
          content: [{ 
            type: "text", 
            text: `Error performing bulk channel search on ${platform}: ${error instanceof Error ? error.message : String(error)}` 
          }],
          isError: true
        };
      }
    }
  • Zod input schema defining the parameters for the 'search-bulk-channels' tool: platform (string), queries (array of strings), optional limit (number), and optional cursor (string).
      platform: z.string().describe("The platform to search on (e.g., 'farcaster')"),
      queries: z.array(z.string()).describe("Array of search queries"),
      limit: z.number().optional().describe("Maximum number of results to return per query"),
      cursor: z.string().optional().describe("Cursor for pagination")
    },
    async ({ platform, queries, limit, cursor }) => {
  • The server.tool call that registers the 'search-bulk-channels' tool on the MCP server, including its name, description, input schema, and handler function.
    server.tool(
      "search-bulk-channels",
      "Search for multiple channels on a social platform in parallel",
      {
        platform: z.string().describe("The platform to search on (e.g., 'farcaster')"),
        queries: z.array(z.string()).describe("Array of search queries"),
        limit: z.number().optional().describe("Maximum number of results to return per query"),
        cursor: z.string().optional().describe("Cursor for pagination")
      },
      async ({ platform, queries, limit, cursor }) => {
        try {
          const provider = providerRegistry.getProviderForPlatform(platform);
          
          if (!provider) {
            throw new Error(`Provider for platform '${platform}' not found`);
          }
    
          // Check if the provider supports bulk channel search
          if (!provider.searchBulkChannels) {
            throw new Error(`Bulk channel search is not supported for platform '${platform}'`);
          }
          
          const results = await provider.searchBulkChannels(queries, {
            limit,
            cursor
          });
          
          // Format the results
          let response = `Search Results for ${queries.length} queries:\n\n`;
          
          for (const [query, result] of Object.entries(results)) {
            response += `Results for "${query}":\n`;
            if (result.channels.length === 0) {
              response += 'No channels found.\n';
            } else {
              const formattedChannels = result.channels.map(channel => 
                `Channel: ${channel.name}\n` +
                `Description: ${channel.description || 'No description'}\n` +
                `Followers: ${channel.followerCount}\n` +
                `Created: ${channel.createdAt}\n` +
                `URL: ${channel.parentUrl || 'N/A'}\n`
              ).join('\n');
              response += formattedChannels + '\n';
            }
            if (result.nextCursor) {
              response += `Use the cursor "${result.nextCursor}" to fetch more results for this query.\n`;
            }
            response += '\n';
          }
          
          return {
            content: [{ type: "text", text: response }],
            isError: false
          };
        } catch (error) {
          console.error(`Error in search-bulk-channels tool:`, error);
          return {
            content: [{ 
              type: "text", 
              text: `Error performing bulk channel search on ${platform}: ${error instanceof Error ? error.message : String(error)}` 
            }],
            isError: true
          };
        }
      }
    );
  • Top-level registration in the main MCP server setup where registerContentTools is called, which in turn registers the 'search-bulk-channels' tool among others.
    registerContentResources(server, providerRegistry);
    registerContentTools(server, providerRegistry);
    registerContentPrompts(server);
Behavior2/5

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

With no annotations provided, the description carries full burden but only mentions parallel execution without detailing rate limits, authentication needs, error handling, or what constitutes a 'channel'. It lacks critical behavioral context for a search operation with multiple queries.

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 appropriately sized and front-loaded with the core functionality.

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?

For a tool with 4 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain return values, error cases, or the implications of parallel execution, leaving significant gaps in understanding how to use it effectively.

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%, so parameters are well-documented in the schema. The description adds no additional meaning about parameters beyond implying 'queries' are processed in parallel, which aligns with schema but doesn't enhance understanding of individual parameters.

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 ('search for multiple channels') and resource ('channels on a social platform'), with the distinctive feature of parallel execution. However, it doesn't explicitly differentiate from its sibling 'search-channels', which might handle single queries or have different behavior.

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-channels' or other search-related siblings. It mentions parallel execution but doesn't specify scenarios where this is beneficial or when to avoid it.

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/Beyond-Network-AI/beyond-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server