Skip to content

Commit d41dadc

Browse files
phernandezclaude
andcommitted
test(mcp): fail when the committed tool reference is stale
The generator tests compared two fresh renders, so a tool docstring or signature change could land without regenerating docs/mcp-tools.md and nothing would notice. Compare the checked-in file against the generator output and point the failure at `just tool-docs`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014pmKq6bqCi6Zp6BTHuZjrp Signed-off-by: phernandez <paul@basicmachines.co>
1 parent a8642d2 commit d41dadc

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/test_generate_tool_docs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,15 @@ def test_generator_documents_every_registered_tool_deterministically() -> None:
8080
assert generate_tool_docs._render(tools) == generate_tool_docs._render(
8181
generate_tool_docs._collect_tools()
8282
)
83+
84+
85+
def test_checked_in_reference_matches_generator_output() -> None:
86+
# docs/mcp-tools.md is a committed artifact the README links to. Without this check a
87+
# tool signature or docstring change ships with a stale reference and nothing notices.
88+
expected = generate_tool_docs._render(generate_tool_docs._collect_tools())
89+
actual = generate_tool_docs.OUTPUT_PATH.read_text(encoding="utf-8")
90+
91+
assert actual == expected, (
92+
"docs/mcp-tools.md is out of date with the MCP tool sources; "
93+
"run `just tool-docs` and commit the regenerated file"
94+
)

0 commit comments

Comments
 (0)