Skip to main content
Glama

list_testruns

Browse and filter test runs by branch, time, author, or environment to find specific executions.

Instructions

Browse and filter your test runs to find specific test executions. Filter by git branch (e.g., 'develop', 'main'), time interval ('Latest', '1h', '2h', '5h', '1d', '3d', '5d', 'weekly', 'monthly', or custom date ranges), commit author, or environment (e.g., 'production', 'staging', 'development'). Supports efficient pagination using page/limit or offset/limit, or use get_all=true to fetch all results (up to 1000). Returns test run summaries with statistics (total, passed, failed, skipped, flaky counts), duration, status, branch, author, and PR information when available. Perfect for answering questions like 'What tests ran on the develop branch?' or 'Show me all test runs from last hour.' The PAT should be configured in mcp.json as TESTDINO_PAT environment variable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID (Required). The TestDino project identifier.
by_branchNoFilter by git branch name (e.g., 'main', 'develop', 'feature/login').
by_time_intervalNoFilter by time interval. Supports: 'Latest' (most recent, no time filter), '1h' (last hour), '2h' (last 2 hours), '5h' (last 5 hours), '12h' (last 12 hours), '1d' (last day), '3d' (last 3 days), '5d' (last 5 days), 'weekly' (last 7 days), 'monthly' (last 30 days), 'last 1 hour', 'last day', 'last 5 days', or '2024-01-01,2024-01-31' (date range).
by_authorNoFilter by commit author name (case-insensitive, partial match).
by_commitNoFilter by git commit hash (full or partial).
by_environmentNoFilter by environment. Example: 'production', 'staging', 'development'.
limitNoNumber of results per page (default: 20, max: 1000).
pageNoPage number (default: 1).
get_allNoGet all results up to 1000 (default: false).

Implementation Reference

  • The main handler function that executes the list_testruns tool logic. It reads the API key, builds query parameters from args, calls the endpoint, and returns the JSON response.
    export async function handleListTestRuns(args?: ListTestRunsArgs) {
      // Read PAT from environment variable (set in mcp.json) or from args
      const token = getApiKey(args);
    
      if (!token) {
        throw new Error(
          "Missing TESTDINO_PAT environment variable. " +
            "Please configure it in your .cursor/mcp.json file under the 'env' section."
        );
      }
    
      if (!args?.projectId) {
        throw new Error("projectId is required");
      }
    
      try {
        const params: ListTestRunsParams = {
          projectId: String(args.projectId),
        };
    
        if (args?.by_branch) {
          params.by_branch = String(args.by_branch);
        }
        if (args?.by_time_interval) {
          params.by_time_interval = String(args.by_time_interval);
        }
        if (args?.by_author) {
          params.by_author = String(args.by_author);
        }
        if (args?.by_commit) {
          params.by_commit = String(args.by_commit);
        }
        if (args?.by_environment) {
          params.by_environment = String(args.by_environment);
        }
        if (args?.limit !== undefined) {
          params.limit = Number(args.limit);
        }
        if (args?.page !== undefined) {
          params.page = Number(args.page);
        }
        if (args?.get_all !== undefined) {
          params.get_all = String(args.get_all);
        }
    
        const listTestRunsUrl = endpoints.listTestRuns(params);
    
        const response = await apiRequestJson<unknown>(listTestRunsUrl, {
          headers: {
            Authorization: `Bearer ${token}`,
          },
        });
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(response, null, 2),
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new Error(`Failed to list test runs: ${errorMessage}`);
      }
    }
  • The tool definition object including inputSchema with all filter parameters (projectId, by_branch, by_time_interval, by_author, by_commit, by_environment, limit, page, get_all).
    export const listTestRunsTool = {
      name: "list_testruns",
      description:
        "Browse and filter your test runs to find specific test executions. Filter by git branch (e.g., 'develop', 'main'), time interval ('Latest', '1h', '2h', '5h', '1d', '3d', '5d', 'weekly', 'monthly', or custom date ranges), commit author, or environment (e.g., 'production', 'staging', 'development'). Supports efficient pagination using page/limit or offset/limit, or use get_all=true to fetch all results (up to 1000). Returns test run summaries with statistics (total, passed, failed, skipped, flaky counts), duration, status, branch, author, and PR information when available. Perfect for answering questions like 'What tests ran on the develop branch?' or 'Show me all test runs from last hour.' The PAT should be configured in mcp.json as TESTDINO_PAT environment variable.",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "string",
            description: "Project ID (Required). The TestDino project identifier.",
          },
          by_branch: {
            type: "string",
            description:
              "Filter by git branch name (e.g., 'main', 'develop', 'feature/login').",
          },
          by_time_interval: {
            type: "string",
            description:
              "Filter by time interval. Supports: 'Latest' (most recent, no time filter), '1h' (last hour), '2h' (last 2 hours), '5h' (last 5 hours), '12h' (last 12 hours), '1d' (last day), '3d' (last 3 days), '5d' (last 5 days), 'weekly' (last 7 days), 'monthly' (last 30 days), 'last 1 hour', 'last day', 'last 5 days', or '2024-01-01,2024-01-31' (date range).",
          },
          by_author: {
            type: "string",
            description:
              "Filter by commit author name (case-insensitive, partial match).",
          },
          by_commit: {
            type: "string",
            description: "Filter by git commit hash (full or partial).",
          },
          by_environment: {
            type: "string",
            description:
              "Filter by environment. Example: 'production', 'staging', 'development'.",
          },
          limit: {
            type: "number",
            description: "Number of results per page (default: 20, max: 1000).",
            default: 20,
          },
          page: {
            type: "number",
            description: "Page number (default: 1).",
            default: 1,
          },
          get_all: {
            type: "boolean",
            description: "Get all results up to 1000 (default: false).",
            default: false,
          },
        },
        required: ["projectId"],
      },
    };
  • src/index.ts:99-101 (registration)
    The tool is registered in the tools array served via ListToolsRequestSchema handler.
    const tools = [
      healthTool,
      listTestRunsTool,
  • src/index.ts:201-205 (registration)
    The CallToolRequestSchema handler routes the name 'list_testruns' to handleListTestRuns.
    if (name === "list_testruns") {
      return await handleListTestRuns(
        args as Parameters<typeof handleListTestRuns>[0]
      );
    }
  • The endpoint builder function that constructs the URL for the list-testruns API call.
    listTestRuns: (params?: {
      projectId?: string;
      by_branch?: string;
      by_time_interval?: string;
      by_author?: string;
      by_commit?: string;
      by_environment?: string;
      limit?: number;
      page?: number;
      get_all?: string | boolean;
    }): string => {
      const baseUrl = getBaseUrl();
      const projectId = params?.projectId || "";
      const { projectId: _, ...queryParams } = params || {};
      const queryString = queryParams ? buildQueryString(queryParams) : "";
      return `${baseUrl}/api/mcp/${projectId}/list-testruns${queryString}`;
    },
Behavior5/5

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

With no annotations, description fully discloses behavior: supports multiple pagination methods (page/limit, offset/limit, get_all), filter options, and return structure (summaries with statistics). Also mentions PAT configuration, adding operational context.

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

Conciseness4/5

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

Description is comprehensive but somewhat lengthy in a single paragraph. Still, every sentence adds value, and key details are front-loaded. Could be broken into bullet points for better scannability.

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

Completeness5/5

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

For a list tool with no output schema, description thoroughly covers return values (statistics, status, branch, etc.), pagination limits, and authentication configuration. No critical gaps given the tool's complexity.

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

Parameters5/5

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

Adds significant value beyond the input schema by providing concrete examples for each parameter (e.g., branch names 'develop', 'main', time interval list, environment examples). Schema coverage is 100%, but description enriches with usage context.

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

Purpose5/5

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

Clearly states verb 'browse and filter' with resource 'test runs', and provides specific examples of use cases. Differentiates from sibling tools by focusing on test runs, not manual runs or test cases.

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

Usage Guidelines4/5

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

Provides clear context with example questions like 'What tests ran on the develop branch?', implying when to use. Does not explicitly state when not to use or mention alternatives, but the examples suffice for guidance.

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

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