Skip to main content
Glama

get_slowest_tests

Identify and analyze the slowest tests in your project to optimize CI pipeline performance. Sort tests by P95 duration, filter by framework or branch, and pinpoint bottlenecks for targeted improvements.

Instructions

Get the slowest tests in a project, sorted by P95 duration.

When using a user API Key (gaf_), you must provide a projectId. Use list_projects first to find available project IDs.

Parameters:

  • projectId (required): Project ID to analyze

  • days (optional): Analysis period in days (default: 30, max: 365)

  • limit (optional): Max tests to return (default: 20, max: 100)

  • framework (optional): Filter by framework (e.g., "playwright", "vitest")

  • branch (optional): Filter by git branch (e.g., "main", "develop")

Returns:

  • List of slowest tests with:

    • name: Short test name

    • fullName: Full test name including describe blocks

    • filePath: Test file path (if available)

    • framework: Test framework used

    • avgDurationMs: Average test duration in milliseconds

    • p95DurationMs: 95th percentile duration (used for sorting)

    • runCount: Number of times the test ran in the period

  • Summary with project info and period

Use cases:

  • "Which tests are slowing down my CI pipeline?"

  • "Find the slowest Playwright tests to optimize"

  • "Show me e2e tests taking over 30 seconds"

  • "What are the slowest tests on the main branch?"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID to get slowest tests for. Required. Use list_projects to find project IDs.
daysNoAnalysis period in days (default: 30)
limitNoMaximum number of tests to return (default: 20)
frameworkNoFilter by test framework (e.g., "playwright", "vitest", "jest")
branchNoFilter by git branch name (e.g., "main", "develop")

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/gaffer-sh/mcp'

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