get_test_run_timeline_kpis
Retrieve timeline KPIs report for a specified test run on BlazeMeter MCP Server to analyze performance metrics and monitor testing progress.
Instructions
Get the timeline KPIs 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 timeline KPIs report for. |
Implementation Reference
- The 'executeFunction' that implements the core logic: authenticates with BlazeMeter credentials, fetches the timeline KPIs report from the API for the given masterId, handles errors, and returns the data or error object.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 timeline KPIs report const url = new URL(`${baseUrl}/api/v4/masters/${masterId}/reports/timeline/kpis`); // 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 timeline KPIs report.' }; } } };
- The tool schema definition, including name, description, input parameters (masterId as required string), used for MCP tool validation.type: 'function', function: { name: 'get_test_run_timeline_kpis', description: 'Get the timeline KPIs 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 timeline KPIs report for.' } }, required: ['masterId'] } } }
- lib/tools.js:7-16 (registration)The 'discoverTools' function that dynamically imports modules from toolPaths (including this tool), extracts 'apiTool', and collects them for MCP registration.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:9-9 (registration)The path to this tool's module is listed in the 'toolPaths' array, enabling its discovery and loading by lib/tools.js.'blazemeter/new-collection/get-test-run-timeline-kpis.js',