Skip to main content
Glama

bruno_validate_collection

Validate the structure and configuration of API collections to ensure they are correctly formatted and ready for testing.

Instructions

Validate a Bruno collection's structure and configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionPathYesPath to the Bruno collection to validate

Implementation Reference

  • Core handler function that parses input parameters, validates the collection path, executes brunoCLI.validateCollection, processes results, and returns formatted text output with summary, errors, and warnings.
    async handle(args: unknown): Promise<ToolResponse> {
      const params = ValidateCollectionSchema.parse(args);
    
      // Validate collection path
      const validation = await validateToolParameters({
        collectionPath: params.collectionPath
      });
    
      if (!validation.valid) {
        throw new McpError(
          ErrorCode.InvalidParams,
          `Invalid collection path: ${validation.errors.join(', ')}`
        );
      }
    
      try {
        const result = await this.brunoCLI.validateCollection(params.collectionPath);
    
        const output: string[] = [];
        output.push('=== Collection Validation ===');
        output.push('');
    
        if (result.valid) {
          output.push('✅ Collection is valid');
        } else {
          output.push('❌ Collection has errors');
        }
        output.push('');
    
        // Summary
        output.push('Summary:');
        output.push(`  bruno.json: ${result.summary.hasBrunoJson ? '✓ Found' : '✗ Missing'}`);
        output.push(`  Total Requests: ${result.summary.totalRequests}`);
        output.push(`  Valid Requests: ${result.summary.validRequests}`);
        output.push(`  Invalid Requests: ${result.summary.invalidRequests}`);
        output.push(`  Environments: ${result.summary.environments}`);
        output.push('');
    
        // Errors
        if (result.errors.length > 0) {
          output.push('Errors:');
          result.errors.forEach((err: string) => output.push(`  ✗ ${err}`));
          output.push('');
        }
    
        // Warnings
        if (result.warnings.length > 0) {
          output.push('Warnings:');
          result.warnings.forEach((warn: string) => output.push(`  ⚠️  ${warn}`));
          output.push('');
        }
    
        if (result.valid && result.warnings.length === 0) {
          output.push('🎉 Collection is ready to use!');
        }
    
        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 validate collection: ${maskedError}`
        );
      }
    }
  • Zod schema for input validation used within the handler to parse and validate the collectionPath parameter.
    const ValidateCollectionSchema = z.object({
      collectionPath: z.string().describe('Path to the Bruno collection to validate')
    });
  • src/index.ts:223-236 (registration)
    Tool registration in the TOOLS array, defining name, description, and inputSchema for the MCP protocol.
    {
      name: 'bruno_validate_collection',
      description: "Validate a Bruno collection's structure and configuration",
      inputSchema: {
        type: 'object',
        properties: {
          collectionPath: {
            type: 'string',
            description: 'Path to the Bruno collection to validate'
          }
        },
        required: ['collectionPath']
      }
    }
  • src/index.ts:297-297 (registration)
    Instantiation and registration of the ValidateCollectionHandler instance in the ToolRegistry.
    this.toolRegistry.register(new ValidateCollectionHandler(this.brunoCLI));
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool validates structure and configuration but doesn't explain what 'validate' entails—e.g., whether it checks syntax, dependencies, or returns errors. It also omits details like permissions needed, rate limits, or output format, leaving key behavioral traits unclear.

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, efficient sentence: 'Validate a Bruno collection's structure and configuration.' It's front-loaded and wastes no words, making it easy to parse. However, it could be slightly more structured by hinting at outcomes or usage, but overall, it's appropriately concise.

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 complexity (validation operation), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'validate' means in practice, what happens on success or failure, or how results are returned. For a tool with no structured behavioral data, this leaves significant gaps in understanding its functionality.

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 has 100% description coverage, with 'collectionPath' documented as 'Path to the Bruno collection to validate.' The description adds no additional parameter semantics beyond this, such as format examples or validation scope. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, but no extra value is provided.

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 tool's purpose: 'Validate a Bruno collection's structure and configuration.' It specifies the verb ('validate') and resource ('Bruno collection'), making the action explicit. However, it doesn't distinguish this from sibling tools like 'bruno_run_collection' or 'bruno_discover_collections,' which limits differentiation.

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, such as needing a valid collection path, or contrast it with siblings like 'bruno_run_collection' (for execution) or 'bruno_validate_environment' (for environment validation). Without such context, users may struggle to select the right tool.

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