Skip to main content
Glama

bruno_run_request

Execute specific API requests from Bruno collections to test endpoints, manage environments, and generate test reports for validation and CI/CD integration.

Instructions

Run a specific request from a Bruno collection

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
collectionPathYesPath to the Bruno collection
requestNameYesName of the request to run
environmentNoName or path of the environment to use (optional)
envVariablesNoEnvironment variables as key-value pairs (optional)
reporterJsonNoPath to write JSON report (optional)
reporterJunitNoPath to write JUnit XML report for CI/CD integration (optional)
reporterHtmlNoPath to write HTML report (optional)
dryRunNoValidate request configuration without executing HTTP call (optional)

Implementation Reference

  • Core execution logic for bruno_run_request tool: parses and validates input using Zod schema, performs security checks on paths and env vars, handles dry-run mode, executes Bruno CLI runRequest command, and returns formatted text response.
    async handle(args: unknown): Promise<ToolResponse> { const params = RunRequestSchema.parse(args); // Security validation const validation = await validateToolParameters({ collectionPath: params.collectionPath, requestName: params.requestName, envVariables: params.envVariables }); if (!validation.valid) { logSecurityEvent({ type: 'access_denied', details: `Run request blocked: ${validation.errors.join(', ')}`, severity: 'error' }); throw new McpError( ErrorCode.InvalidRequest, `Security validation failed: ${validation.errors.join(', ')}` ); } // Log warnings if any if (validation.warnings.length > 0) { validation.warnings.forEach(warning => { logSecurityEvent({ type: 'env_var_validation', details: warning, severity: 'warning' }); }); } // Handle dry run mode if (params.dryRun) { return await this.handleDryRun(params); } const result = await this.brunoCLI.runRequest( params.collectionPath, params.requestName, { environment: params.environment || params.enviroment, envVariables: params.envVariables, reporterJson: params.reporterJson, reporterJunit: params.reporterJunit, reporterHtml: params.reporterHtml } ); return { content: [ { type: 'text', text: this.formatter.format(result) } as TextContent ] }; }
  • Zod validation schema for bruno_run_request tool parameters, used internally in the handler for runtime type checking.
    const RunRequestSchema = z.object({ collectionPath: z.string().describe('Path to the Bruno collection'), requestName: z.string().describe('Name of the request to run'), environment: z.string().optional().describe('Name or path of the environment to use'), enviroment: z.string().optional().describe('Alias for environment (to handle common typo)'), envVariables: z.record(z.string()).optional().describe('Environment variables as key-value pairs'), reporterJson: z.string().optional().describe('Path to write JSON report'), reporterJunit: z.string().optional().describe('Path to write JUnit XML report'), reporterHtml: z.string().optional().describe('Path to write HTML report'), dryRun: z.boolean().optional().describe('Validate request without executing HTTP call') });
  • Official MCP Tool schema definition for bruno_run_request, including name, description, inputSchema, and required parameters. Used by listTools request.
    { name: 'bruno_run_request', description: 'Run a specific request from a Bruno collection', inputSchema: { type: 'object', properties: { collectionPath: { type: 'string', description: 'Path to the Bruno collection' }, requestName: { type: 'string', description: 'Name of the request to run' }, environment: { type: 'string', description: 'Name or path of the environment to use' }, enviroment: { type: 'string', description: 'Alias for environment (to handle common typo)' }, envVariables: { type: 'object', description: 'Environment variables as key-value pairs', additionalProperties: { type: 'string' } }, reporterJson: { type: 'string', description: 'Path to write JSON report' }, reporterJunit: { type: 'string', description: 'Path to write JUnit XML report' }, reporterHtml: { type: 'string', description: 'Path to write HTML report' }, dryRun: { type: 'boolean', description: 'Validate request without executing HTTP call' } }, required: ['collectionPath', 'requestName'] } },
  • src/index.ts:289-289 (registration)
    Registers the RunRequestHandler instance with ToolRegistry, mapping 'bruno_run_request' (via getName()) to its execution handler.
    this.toolRegistry.register(new RunRequestHandler(this.brunoCLI));
  • Handler's getName() method returning the tool identifier 'bruno_run_request' for registry lookup.
    getName(): string { return 'bruno_run_request'; }

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