Skip to main content
Glama
pbandreddy

LoadRunner Cloud MCP Server

by pbandreddy

test_runs_getTestRunTransactions

Retrieve detailed transaction information for a specific test run using the test run ID to analyze and optimize performance outcomes in LoadRunner Cloud.

Instructions

List all transaction information in a test run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
runIdYesThe ID of the test run.

Implementation Reference

  • The main handler function that executes the tool: authenticates using getAuthToken, constructs the API URL for test run transactions, appends query parameters, makes a GET request, handles errors, and parses the JSON response.
    const executeFunction = async ({ runId }) => { const baseUrl = process.env.LRC_BASE_URL; const tenantId = process.env.LRC_TENANT_ID; const token = await getAuthToken(); try { // Construct the URL with query parameters const url = new URL(`${baseUrl}/test-runs/${runId}/transactions`); url.searchParams.append('TENANTID', tenantId); url.searchParams.append('percentile', 90); url.searchParams.append('percentile', 95); // Set up headers for the request const headers = { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }; // Perform the fetch request const response = await fetch(url.toString(), { method: 'GET', headers }); // Check if the response was successful if (!response.ok) { const text = await response.text(); try { const errorData = JSON.parse(text); throw new Error(JSON.stringify(errorData)); } catch (jsonErr) { // Not JSON, log the raw text console.error('Non-JSON error response:', text); throw new Error(text); } } // Parse and return the response data const text = await response.text(); try { const data = JSON.parse(text); return data; } catch (jsonErr) { // Not JSON, log the raw text console.error('Non-JSON success response:', text); return { error: 'Received non-JSON response from API', raw: text }; } } catch (error) { console.error('Error retrieving test run transactions:', error); return { error: 'An error occurred while retrieving test run transactions.' }; } };
  • Input schema definition for the tool, specifying the required 'runId' string parameter.
    name: 'test_runs_getTestRunTransactions', description: 'List all transaction information in a test run.', parameters: { type: 'object', properties: { runId: { type: 'string', description: 'The ID of the test run.' } }, required: ['runId'] } }
  • Tool registration object 'apiTool' that combines the handler function and schema definition, exported for dynamic discovery and loading in lib/tools.js.
    const apiTool = { function: executeFunction, definition: { type: 'function', function: { name: 'test_runs_getTestRunTransactions', description: 'List all transaction information in a test run.', parameters: { type: 'object', properties: { runId: { type: 'string', description: 'The ID of the test run.' } }, required: ['runId'] } } } }; export { apiTool };
  • Import of the shared authentication helper function used by the handler.
    import { getAuthToken } from './auth-get-token.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/loadrunner-cloud-mcp-server'

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