Skip to main content
Glama

bruno_discover_collections

Search directory trees to find Bruno API collections for testing, specifying path and depth to locate files.

Instructions

Discover Bruno collections in a directory tree

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchPathYesDirectory path to search for Bruno collections
maxDepthNoMaximum directory depth to search (default: 5)

Implementation Reference

  • The DiscoverCollectionsHandler class implements IToolHandler for 'bruno_discover_collections'. It validates input, calls BrunoCLI to discover collections, formats the output as text, and handles errors.
    export class DiscoverCollectionsHandler implements IToolHandler {
      private readonly brunoCLI: IBrunoCLI;
    
      constructor(brunoCLI: IBrunoCLI) {
        this.brunoCLI = brunoCLI;
      }
    
      getName(): string {
        return 'bruno_discover_collections';
      }
    
      async handle(args: unknown): Promise<ToolResponse> {
        const params = DiscoverCollectionsSchema.parse(args);
    
        // Validate search path
        const validation = await validateToolParameters({
          collectionPath: params.searchPath
        });
    
        if (!validation.valid) {
          throw new McpError(
            ErrorCode.InvalidParams,
            `Invalid search path: ${validation.errors.join(', ')}`
          );
        }
    
        try {
          const collections = await this.brunoCLI.discoverCollections(
            params.searchPath,
            params.maxDepth || 5
          );
    
          const output: string[] = [];
    
          if (collections.length === 0) {
            output.push(`No Bruno collections found in: ${params.searchPath}`);
            output.push('');
            output.push('A Bruno collection is a directory containing a bruno.json file.');
          } else {
            output.push(`Found ${collections.length} Bruno collection(s):\n`);
    
            collections.forEach((collectionPath, index) => {
              output.push(`${index + 1}. ${collectionPath}`);
            });
          }
    
          return {
            content: [
              {
                type: 'text',
                text: output.join('\n')
              } as TextContent
            ]
          };
        } catch (error) {
          const maskedError = error instanceof Error ? maskSecretsInError(error) : error;
          throw new McpError(
            ErrorCode.InternalError,
            `Failed to discover collections: ${maskedError}`
          );
        }
      }
    }
  • Input schema and metadata for the bruno_discover_collections tool, registered in the TOOLS array for the listTools MCP request.
    {
      name: 'bruno_discover_collections',
      description: 'Discover Bruno collections in a directory tree',
      inputSchema: {
        type: 'object',
        properties: {
          searchPath: {
            type: 'string',
            description: 'Directory path to search for Bruno collections'
          },
          maxDepth: {
            type: 'number',
            description: 'Maximum directory depth to search (default: 5)'
          }
        },
        required: ['searchPath']
      }
    },
  • src/index.ts:293-293 (registration)
    Instantiation and registration of the DiscoverCollectionsHandler with the ToolRegistry in the BrunoMCPServer setup.
    this.toolRegistry.register(new DiscoverCollectionsHandler(this.brunoCLI));
  • Zod schema used within the handler for parsing and validating tool input parameters.
    const DiscoverCollectionsSchema = z.object({
      searchPath: z.string().describe('Directory path to search for Bruno collections'),
      maxDepth: z.number().optional().describe('Maximum directory depth to search (default: 5)')
    });
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. While 'Discover' implies a read-only operation, it doesn't specify whether this is a recursive search, what format the results are in, or if there are any performance considerations like timeouts for large directory trees. The description lacks critical behavioral details needed for safe invocation.

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 perfectly concise - a single sentence that communicates the core purpose without any wasted words. It's front-loaded with the essential information and earns its place efficiently.

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 no annotations and no output schema, the description is insufficiently complete. It doesn't explain what constitutes a 'Bruno collection' (file format? directory structure?), what the output looks like, or how results are structured. The agent would be operating with significant uncertainty about both behavior and results.

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 the input schema already documents both parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it mentions 'directory tree' which aligns with 'searchPath' but provides no additional context about valid paths, error handling, or the relationship between 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 ('Discover') and resource ('Bruno collections in a directory tree'), making the tool's purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'bruno_list_requests' or 'bruno_list_environments' which might also involve discovery operations, so it doesn't reach the highest score.

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. With siblings like 'bruno_list_requests' and 'bruno_list_environments' available, there's no indication whether this tool is for file-based discovery while others might be for API-based listing, leaving the agent to guess about appropriate contexts.

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

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/jcr82/bruno-mcp-server'

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