get_test_run_summary
Retrieve a summary report for a specified BlazeMeter performance test run to analyze results and identify issues.
Instructions
Get the summary report for a specified test run (master).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| masterId | Yes | The ID of the test run (master) to retrieve the summary for. |
Implementation Reference
- The handler function that performs the HTTP GET request to the BlazeMeter API to fetch the summary report for the specified test run master ID.const executeFunction = async ({ masterId }) => { 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 for the summary report const url = new URL(`${baseUrl}/api/v4/masters/${masterId}/reports/default/summary`); // 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 run summary.' }; } } };
- Tool schema definition including the name, description, input parameters schema requiring 'masterId' string.type: 'function', function: { name: 'get_test_run_summary', description: 'Get the summary report for a specified test run (master).', parameters: { type: 'object', properties: { masterId: { type: 'string', description: 'The ID of the test run (master) to retrieve the summary for.' } }, required: ['masterId'] } } }
- lib/tools.js:7-16 (registration)Dynamic registration loader that imports all tool modules listed in toolPaths and extracts their apiTool configurations.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:1-10 (registration)Central list of all tool file paths, including the path to get-test-run-summary.js, used by the discoverTools function.export const toolPaths = [ 'blazemeter/new-collection/get-workspace-list.js', 'blazemeter/new-collection/get-project-list.js', 'blazemeter/new-collection/get-test-runs-list.js', 'blazemeter/new-collection/get-test-run-summary.js', 'blazemeter/new-collection/get-test-run-aggregate-data.js', 'blazemeter/new-collection/get-test-run-errors-data.js', 'blazemeter/new-collection/get-test-run-thresholds.js', 'blazemeter/new-collection/get-test-run-timeline-kpis.js', ];