Skip to main content
Glama

create-test-run

Create a new test run for a project in QA Studio by specifying project ID, name, environment, and optional details to organize testing activities.

Instructions

Create a new test run for a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesThe project ID to create the test run for
nameYesName of the test run
environmentYesEnvironment name (e.g., "production", "staging", "local")
descriptionNoOptional description of the test run
milestoneIdNoOptional milestone ID to associate with the test run

Implementation Reference

  • The main handler function for the 'create-test-run' tool. It extracts arguments, sends a POST request to the /runs API endpoint to create a test run, and returns a formatted success message with the new run's details or an error response.
    async (args) => { try { const { projectId, name, description, environment, milestoneId } = args; const data = await apiRequest(`/runs`, { method: 'POST', body: JSON.stringify({ projectId, name, description, environment, milestoneId }) }); return { content: [ { type: 'text' as const, text: `✅ Test run created successfully!\n\nID: ${data.id}\nName: ${data.name}\nEnvironment: ${data.environment}\n\nView: ${API_URL.replace('/api', '')}/projects/${projectId}/runs/${data.id}` } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • Zod input schema defining the required and optional parameters for creating a test run: projectId, name, environment, description, and milestoneId.
    inputSchema: { projectId: z.string().describe('The project ID to create the test run for'), name: z.string().describe('Name of the test run'), environment: z.string().describe('Environment name (e.g., "production", "staging", "local")'), description: z.string().optional().describe('Optional description of the test run'), milestoneId: z .string() .optional() .describe('Optional milestone ID to associate with the test run') }
  • src/index.ts:86-136 (registration)
    Registration of the 'create-test-run' tool using server.registerTool, including schema and inline handler function.
    server.registerTool( 'create-test-run', { description: 'Create a new test run for a project', inputSchema: { projectId: z.string().describe('The project ID to create the test run for'), name: z.string().describe('Name of the test run'), environment: z.string().describe('Environment name (e.g., "production", "staging", "local")'), description: z.string().optional().describe('Optional description of the test run'), milestoneId: z .string() .optional() .describe('Optional milestone ID to associate with the test run') } }, async (args) => { try { const { projectId, name, description, environment, milestoneId } = args; const data = await apiRequest(`/runs`, { method: 'POST', body: JSON.stringify({ projectId, name, description, environment, milestoneId }) }); return { content: [ { type: 'text' as const, text: `✅ Test run created successfully!\n\nID: ${data.id}\nName: ${data.name}\nEnvironment: ${data.environment}\n\nView: ${API_URL.replace('/api', '')}/projects/${projectId}/runs/${data.id}` } ] }; } catch (error) { return { content: [ { type: 'text' as const, text: `Error: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
  • Shared helper function apiRequest used by the handler to make authenticated API requests to the QA Studio backend.
    async function apiRequest(endpoint: string, options: RequestInit = {}): Promise<any> { const url = `${API_URL}${endpoint}`; const response = await fetch(url, { ...options, headers: { 'Content-Type': 'application/json', 'X-API-Key': API_KEY, ...options.headers } }); if (!response.ok) { const error = await response.text(); throw new Error(`API Error (${response.status}): ${error}`); } return response.json(); }

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

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