Skip to main content
Glama

Get Slowest Tests

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")

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
slowestTestsYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it explains the sorting logic ('sorted by P95 duration'), default values and limits for parameters, and the structure of the return data. However, it lacks details on error handling, rate limits, or authentication requirements beyond the API key note, which are minor gaps.

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?

The description is well-structured with clear sections (purpose, prerequisites, parameters, returns, use cases) and uses bullet points for readability. It is appropriately sized but includes some redundancy, such as repeating parameter details that are already in the schema, which slightly reduces efficiency.

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?

Given the tool's complexity (5 parameters, no annotations, but with an output schema), the description is complete. It covers purpose, usage guidelines, parameters, return values, and practical use cases. The output schema handles return value details, so the description doesn't need to explain them further, making it sufficient for effective tool selection and invocation.

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?

Schema description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds minimal value beyond the schema by listing parameters with brief notes, but it doesn't provide additional context like examples for 'framework' beyond what's in the schema. This meets the baseline for high schema coverage.

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?

The description clearly states the tool's purpose: 'Get the slowest tests in a project, sorted by P95 duration.' It specifies the verb ('Get'), resource ('slowest tests'), and key sorting criterion ('P95 duration'), which distinguishes it from siblings like 'get_flaky_tests' or 'get_test_history' that focus on different test metrics.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: it states when to use the tool ('When using a user API Key (gaf_), you must provide a projectId'), directs users to an alternative tool for prerequisite steps ('Use list_projects first to find available project IDs'), and includes use-case examples that clarify context, such as identifying CI pipeline bottlenecks or optimizing specific frameworks.

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

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