Skip to main content
Glama

link_test_to_spec

Record a test-to-spec link in the coverage matrix index, with automatic timestamp updates on re-link to maintain accurate traceability.

Instructions

Record that a test verifies a spec. Writes into SPEC_PROJECT_ROOT/.mk-spec-master/index.json (data ownership stays with the user). Re-linking the same node_id updates the timestamp instead of duplicating. Call this right after mk-qa-master.generate_test returns a node_id so the coverage matrix stays current. Pass spec_title / spec_source / spec_url (typically already known from earlier fetch_spec) to cache them into the index so get_coverage_matrix can render titles without re-fetching from the source. Pass ac_hash (from parse_spec._meta.ac_hash) to enable drift detection via get_drift_report. Returns {action: 'added'|'updated', spec_id, test_node_id, total_links_for_spec}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spec_idYes
test_node_idYesTest framework node id, e.g. tests/test_checkout.py::test_apply_discount
spec_titleNo
spec_sourceNo
spec_urlNo
ac_hashNoSHA-256 of the canonical AC block, as returned by parse_spec._meta.ac_hash. Enables drift detection.
Behavior5/5

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

Discloses file write location, data ownership, idempotency (duplicate handling via timestamp update), and purpose of caching metadata. Explains return values. No annotations, so full burden borne well.

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?

Single paragraph but each sentence adds value. Front-loaded with core purpose. Slightly long but not wasteful; could be tighter, but no redundancy.

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?

Covers purpose, usage flow, parameter explanations, return values, and references sibling tools (get_coverage_matrix, get_drift_report). No output schema but return structure described. Complete for a mutation/link tool.

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?

Schema coverage is only 33% (2 out of 6 params have descriptions). Description compensates fully: explains why spec_title/spec_source/spec_url are cached, ac_hash for drift detection, and roles of spec_id and test_node_id. Adds significant meaning beyond schema.

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?

Clearly states the action: 'Record that a test verifies a spec.' Specifies verb (record link), resource (test-spec relationship), and details like file path. Distinct from siblings like auto_link_tests or get_coverage_matrix.

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?

Explicit timing guidance: 'Call this right after mk-qa-master.generate_test returns a node_id.' Explains why and when to pass optional params. Lacks explicit 'when not to use' but context is clear.

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