Skip to main content
Glama

auto_link_tests

Scan test files for @spec tags and link tests to specs. Supports Python, JavaScript, and Go with dry-run preview.

Instructions

Scan a directory of test files for @spec: <ID> tags in docstrings or comments and call link_test_to_spec for each (test, spec) pair found. Supports Python (def test_*), JS/TS (it('...') / test('...')), and Go (func TestX(t *testing.T)). For each tag the nearest preceding test function within 30 lines is treated as the owner; test_node_id is <relative-path>::<test-name>. Use when a user says 'rebuild the spec coverage' or 'sync test → spec links after the refactor'. Set dry_run: true to preview without writing. Returns {test_dir, files_scanned, tags_found, links_added, links_updated, skipped, discoveries[], markdown, dry_run}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
test_dirNoAbsolute path to scan. Defaults to SPEC_PROJECT_ROOT/tests, falling back to SPEC_PROJECT_ROOT.
languagesNoSubset of supported languages. Default: all three.
dry_runNo
Behavior5/5

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

With no annotations, the description carries full burden and discloses all essential behaviors: scanning files, owner detection within 30 lines, test_node_id format, calling link_test_to_spec, and dry_run effect. It is transparent about the operation and side effects.

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 reasonably concise given the amount of detail, with the main purpose stated upfront. It includes necessary technical specifics without excessive verbosity, though it could be slightly streamlined.

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?

Despite lacking annotations and output schema, the description provides rich context: default directories, language support, tag pattern, matching heuristic, test_node_id format, return object fields, and dry_run behavior. It covers all aspects needed for an agent to use the tool correctly.

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?

The description adds significant meaning beyond the input schema: it explains default behavior for test_dir, enumerates languages concretely, and provides the only description for dry_run. Schema coverage is 67%, but the description compensates fully, making parameter usage clear.

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 scans a directory for @spec tags and calls link_test_to_spec for each found pair, specifying the supported languages and matching logic. It distinguishes itself from the sibling link_test_to_spec by acting as a batch automation tool.

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 mentions when to use the tool: when a user says 'rebuild the spec coverage' or 'sync test → spec links after the refactor'. It also advises setting dry_run to preview. However, it does not explicitly state when not to use it or mention alternatives.

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/kao273183/mk-spec-master'

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