Skip to main content
Glama
pbandreddy

BlazeMeter MCP Server

by pbandreddy

get_test_runs

Retrieve performance test runs for a specific test to analyze results and track execution history.

Instructions

Get test runs (masters) for a specified test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testIdYesThe ID of the test to retrieve runs for.

Implementation Reference

  • The main handler function 'executeFunction' that makes an authenticated GET request to the BlazeMeter /api/v4/masters endpoint with testId query param to retrieve the list of test runs.
    const executeFunction = async ({ testId }) => {
      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 with query parameters
        const url = new URL(`${baseUrl}/api/v4/masters`);
        url.searchParams.append('testId', testId);
    
        // 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 runs.' };
        }
      }
    };
  • Schema definition for the tool, specifying the name, description, and required 'testId' string parameter.
      function: {
        name: 'get_test_runs',
        description: 'Get test runs (masters) for a specified test.',
        parameters: {
          type: 'object',
          properties: {
            testId: {
              type: 'string',
              description: 'The ID of the test to retrieve runs for.'
            }
          },
          required: ['testId']
        }
      }
    }
  • The 'apiTool' export that registers the tool by associating the handler with its OpenAI-compatible tool definition (schema). This is dynamically loaded by lib/tools.js#discoverTools().
    const apiTool = {
      function: executeFunction,
      definition: {
        type: 'function',
        function: {
          name: 'get_test_runs',
          description: 'Get test runs (masters) for a specified test.',
          parameters: {
            type: 'object',
            properties: {
              testId: {
                type: 'string',
                description: 'The ID of the test to retrieve runs for.'
              }
            },
            required: ['testId']
          }
        }
      }
    };
    
    export { apiTool }; 
  • Helper function that discovers all tools by dynamically importing the apiTool from each file listed in tools/paths.js, enabling registration in the MCP server.
    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);
    }
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 of behavioral disclosure. It states the action is 'Get', implying a read operation, but doesn't specify if it's safe, requires permissions, returns paginated results, or details error handling. For a tool with zero annotation coverage, this is a significant gap in transparency.

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, efficient sentence with zero waste. It's front-loaded with the core purpose, making it easy to scan and understand quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'test runs (masters)' entails, the return format, or behavioral traits like safety or limitations. For a tool that likely returns data, more context is needed to guide the agent effectively.

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

Parameters3/5

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

The input schema has 100% description coverage, with 'testId' documented as 'The ID of the test to retrieve runs for.' The description adds no additional parameter semantics beyond this, so it meets the baseline of 3 where the schema does the heavy lifting.

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 verb 'Get' and the resource 'test runs (masters) for a specified test', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_test_run_summary' or 'get_test_run_aggregate_data', which likely retrieve related but different data about test runs.

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 prerequisites, exclusions, or compare it to siblings such as 'get_test_run_summary', leaving the agent to infer usage from tool names alone.

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/blazemeter-mcp-server'

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