Skip to main content
Glama
pbandreddy

LoadRunner Cloud MCP Server

by pbandreddy

projects_getLoadTestScripts

Retrieve load test scripts from LoadRunner Cloud by specifying the project and load test IDs. Supports performance engineering workflows and data integration for enhanced testing automation.

Instructions

Retrieve scripts for a load test in a project from LoadRunner Cloud.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
loadTestIdYesThe ID of the load test.
projectIdYesThe ID of the project.

Implementation Reference

  • The main handler function `executeFunction` that performs the authenticated API GET request to LoadRunner Cloud to retrieve scripts for a specific load test in a project.
    const executeFunction = async ({ projectId, loadTestId }) => { 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}/projects/${projectId}/load-tests/${loadTestId}/scripts`); url.searchParams.append('TENANTID', tenantId); // 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 load test scripts:', error); return { error: 'An error occurred while retrieving load test scripts.' }; } };
  • The JSON schema definition for the tool, including name, description, and input parameters (projectId and loadTestId).
    name: 'projects_getLoadTestScripts', description: 'Retrieve scripts for a load test in a project from LoadRunner Cloud.', parameters: { type: 'object', properties: { projectId: { type: 'string', description: 'The ID of the project.' }, loadTestId: { type: 'string', description: 'The ID of the load test.' } }, required: ['projectId', 'loadTestId'] }
  • lib/tools.js:7-16 (registration)
    The `discoverTools` function dynamically imports all tool modules listed in paths.js using dynamic import and spreads their `apiTool` exports to register the tools.
    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); }
  • Array of relative paths to all LoadRunner Cloud tool files, including this tool at index 7 (line 9), used by discoverTools for registration.
    export const toolPaths = [ 'loadrunner-cloud/load-runner-cloud-api/projects-get-projects.js', 'loadrunner-cloud/load-runner-cloud-api/test-runs-get-active-test-runs.js', 'loadrunner-cloud/load-runner-cloud-api/test-runs-get-test-run-transactions.js', 'loadrunner-cloud/load-runner-cloud-api/test-runs-get-test-run-summary.js', 'loadrunner-cloud/load-runner-cloud-api/test-runs-get-http-responses.js', 'loadrunner-cloud/load-runner-cloud-api/test-runs-get-test-run-recent.js', 'loadrunner-cloud/load-runner-cloud-api/projects-get-load-tests.js', 'loadrunner-cloud/load-runner-cloud-api/projects-get-load-test-scripts.js', 'loadrunner-cloud/load-runner-cloud-api/projects-get-load-test-runs.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