Skip to main content
Glama

get_affected_tests

Determine which tests to run after a code change by analyzing the import graph to find affected test files from your changed source files.

Instructions

Given a list of changed source files, returns which test files are affected — directly or transitively through the import graph. Use to answer: which tests should I run after this code change?

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
git_diffNoRaw output of `git diff --name-only` — newline-separated file paths. Use instead of changed_files when piping git output directly.
project_rootYesAbsolute path to the TypeScript project root (must contain tsconfig.json)
changed_filesNoList of changed file paths (absolute or relative to project_root)
Behavior4/5

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

With no annotations, the description carries the burden of disclosing behavior. It reveals the transitive dependency traversal through the import graph, which is a meaningful behavioral trait beyond simple reading. It lacks details on output format or error handling, but for a read-only analysis tool this is sufficient.

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

Conciseness5/5

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

Two sentences, front-loaded with the core purpose, followed by a practical usage question. No wasted words.

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

Completeness4/5

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

The description covers the purpose, usage, and computation method. It does not specify the return format (e.g., array of paths), but no output schema is present and the tool is relatively simple. The absence of edge-case documentation (e.g., empty input) is a minor gap.

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?

All three parameters have descriptions in the schema (100% coverage). The description conceptually maps to 'changed source files' but adds no additional syntax or format beyond the schema. Baseline 3 is appropriate.

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 states a specific verb ('returns'), a resource ('test files'), and the mechanism (directly or transitively through the import graph). It clearly distinguishes from siblings like get_affected_tests_by_branch by specifying input as a list of changed source files.

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?

The description explicitly frames the use case with 'Use to answer: which tests should I run after this code change?' and defines the required input condition. It does not mention alternatives or exclusions, but provides clear contextual 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/vola-trebla/ast-impact-mapper-mcp'

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