Skip to main content
Glama
pbandreddy

LoadRunner Cloud MCP Server

by pbandreddy

get_projects

Retrieve all projects in a tenant to manage performance test data and build engineering workflows.

Instructions

Retrieve all projects in a tenant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that fetches the list of projects from LoadRunner Cloud API using authentication token.
    const executeFunction = async () => {
      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`);
        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 projects:', error);
        return { error: 'An error occurred while retrieving projects.' };
      }
    };
  • Tool definition including schema for parameters (empty) and description.
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'get_projects',
          description: 'Retrieve all projects in a tenant.',
          parameters: {
            type: 'object',
            properties: {},
            required: []
          }
        }
      }
    };
  • lib/tools.js:7-16 (registration)
    Registers the get_projects tool by dynamically importing and collecting apiTool from all tool files listed in paths.js.
    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);
    }
  • Helper function to obtain authentication token required for API calls including get_projects.
    const getAuthToken = async () => {
      const baseUrl = process.env.LRC_BASE_URL;
      const tenantId = process.env.LRC_TENANT_ID;
      const clientId = process.env.LRC_CLIENT_ID;
      const clientSecret = process.env.LRC_CLIENT_SECRET;
    
      try {
        const url = new URL(`${baseUrl}/auth-client`);
        url.searchParams.append('TENANTID', tenantId);
    
        const headers = {
          'Content-Type': 'application/json',
          'accept': 'application/json'
        };
    
        const body = JSON.stringify({
          client_id: clientId,
          client_secret: clientSecret
        });
    
        const response = await fetch(url.toString(), {
          method: 'POST',
          headers,
          body
        });
    
        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);
          }
        }
    
        const data = await response.json();
        // Adjust according to actual API response structure
        return data.access_token || data.token || data;
      } catch (error) {
        console.error('Error retrieving auth token:', error);
        return { error: 'An error occurred while retrieving auth token.' };
      }
    };
  • tools/paths.js:1-2 (registration)
    Lists the path to the get_projects tool file for dynamic registration.
    export const toolPaths = [
      'loadrunner-cloud/load-runner-cloud-api/projects-get-projects.js',
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Retrieve all projects' but doesn't disclose behavioral traits such as pagination, rate limits, authentication needs, or what 'all' entails (e.g., archived projects). This leaves significant gaps for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded with the essential action and resource, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 0 parameters, no output schema, and no annotations, the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, or usage context, which are needed for full completeness in a retrieval tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here, but it implies a scope ('in a tenant') that aligns with the lack of parameters, justifying a score above baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve') and resource ('all projects in a tenant'), making the purpose understandable. However, it doesn't distinguish this from potential sibling tools that might also retrieve projects with different scopes or filters, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for usage, or exclusions, leaving the agent with minimal direction beyond the basic purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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