Skip to main content
Glama

run_tests

Execute standardized tests for projects, automatically enabling coverage mode when no specific test file pattern is provided.

Instructions

Run standardized tests for the project (with coverage when no pattern specified)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
patternNoTest file pattern to match (runs coverage mode if omitted)

Implementation Reference

  • The RunTestsTool class that extends BaseExecTool, providing the specific logic to build the test execution command based on input pattern and project config.
    class RunTestsTool extends BaseExecTool<TestRunnerOptions> { protected getActionName(): string { return 'Test'; } protected async buildCommand(args: TestRunnerOptions): Promise<string> { const { pattern } = args; const config = await loadProjectConfig(); // If no pattern specified, run tests with coverage if (!pattern) { return 'npm run test:coverage'; } // Otherwise run the configured test command with the pattern const command = config.testCommand ?? 'npm test'; return `${command} ${pattern}`; } }
  • Interface defining the input parameters for the run_tests tool: an optional pattern string to filter tests.
    export interface TestRunnerOptions { pattern?: string; }
  • The exported handler function runTests that invokes the tool instance's execute method, serving as the entry point for the tool.
    export async function runTests(args: TestRunnerOptions): Promise<CallToolResult> { return tool.execute(args); }

Other Tools

Related 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/jaggederest/mcp_reviewer'

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