Skip to main content
Glama
pbandreddy

BlazeMeter MCP Server

by pbandreddy

get_test_runs

Retrieve test runs for a specified test ID to monitor and analyze performance data using the BlazeMeter MCP Server.

Instructions

Get test runs (masters) for a specified test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testIdYesThe ID of the test to retrieve runs for.

Implementation Reference

  • The handler function 'executeFunction' that makes a GET request to BlazeMeter API (/api/v4/masters?testId=...) to retrieve test runs (masters) for the given testId, handles errors, and returns the data or error object.
    const executeFunction = async ({ testId }) => { const baseUrl = process.env.BASE_URL; // loaded from .env const username = process.env.BZM_USERNAME; // loaded from .env const password = process.env.BZM_PASSWORD; // loaded from .env try { // Construct the URL with query parameters const url = new URL(`${baseUrl}/api/v4/masters`); url.searchParams.append('testId', testId); // Set up headers for the request const headers = { 'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'), 'Accept': 'application/json' }; // Perform the fetch request const response = await fetch(url.toString(), { method: 'GET', headers }); // Check if the response was successful if (!response.ok) { let errorData; try { errorData = await response.json(); } catch (jsonErr) { errorData = await response.text(); } throw new Error(`HTTP ${response.status} ${response.statusText}: ${typeof errorData === 'string' ? errorData : JSON.stringify(errorData)}`); } // Parse and return the response data const data = await response.json(); return data; } catch (error) { if (error instanceof Error) { return { error: error.message }; } else { return { error: 'Unknown error occurred while getting test runs.' }; } } };
  • The tool schema definition including name 'get_test_runs', description, and parameters schema requiring 'testId' string.
    definition: { type: 'function', function: { name: 'get_test_runs', description: 'Get test runs (masters) for a specified test.', parameters: { type: 'object', properties: { testId: { type: 'string', description: 'The ID of the test to retrieve runs for.' } }, required: ['testId'] } } } };
  • lib/tools.js:7-16 (registration)
    Dynamic registration/discovery of all tools by importing modules from toolPaths and spreading their apiTool objects.
    export async function discoverTools() { const toolPromises = toolPaths.map(async (file) => { const module = await import(`../tools/${file}`); return { ...module.apiTool, path: file, }; }); return Promise.all(toolPromises); }
  • tools/paths.js:4-4 (registration)
    The tool path for 'get_test_runs' is listed in the toolPaths array used for dynamic loading.
    'blazemeter/new-collection/get-test-runs-list.js',

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/pbandreddy/blazemeter-mcp-server'

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