Skip to main content
Glama
get-run-details.ts2.27 kB
/** * Get run details tool */ import { endpoints } from "../../lib/endpoints.js"; import { apiRequestJson } from "../../lib/request.js"; import { getApiKey } from "../../lib/env.js"; export const getRunDetailsTool = { name: "get_run_details", description: "Get detailed information about test runs. Shows test statistics (passed, failed, skipped, flaky), all test suites and cases, git metadata, and error details. Supports batch operations (comma-separated IDs, max 20). Use this to analyze test execution health or debug specific failures.", inputSchema: { type: "object", properties: { testrun_id: { type: "string", description: "Test run ID(s). Single ID or comma-separated for batch (max 20). Example: 'test_run_123' or 'run1,run2,run3'.", }, counter: { type: "number", description: "Filter by test run counter (sequential number).", }, }, }, }; export async function handleGetRunDetails(args: any) { // Read API key from environment variable (set in mcp.json) or from args const token = getApiKey(args); if (!token) { throw new Error( "Missing TESTDINO_API_KEY environment variable. " + "Please configure it in your .cursor/mcp.json file under the 'env' section." ); } try { // Build query parameters const params: any = {}; if (args.testrun_id) { params.testrun_id = String(args.testrun_id); } if (args.counter !== undefined) { params.counter = Number(args.counter); } const runDetailsUrl = endpoints.getRunDetails(params); const response = await apiRequestJson(runDetailsUrl, { headers: { Authorization: `Bearer ${token}`, }, }); // Always return output directly as text content, never write to file // This ensures the output is displayed directly regardless of size return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error: any) { throw new Error( `Failed to retrieve test run details: ${error?.message || String(error)}` ); } }

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/testdino-inc/testdino-mcp'

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