Why an MCP tool for coding conventions went unused, and what caught AI agent rule violations instead
The author built an MCP server exposing a tool that returns a directory's coding conventions before an AI agent edits a file. In 15 controlled runs the agent never called the tool, even after its description was rewritten to be more imperative. The author concludes that agents will not voluntarily look up knowledge they do not realize they lack. A PreToolUse hook injecting rules before each edit also failed to change output, because the agent had already authored the code by then. What worked was a PostToolUse hook that re-parses edited files, checks them against conventions mined from the directory, and returns violations to the agent as errors.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in