Check code for smells
quality.smell_checkReadsOnly looks things up; never changes your workspace.What it does
Scans a file, function or diff for code smells: warning signs that code will be hard to change, such as a very long function, a function with many parameters, or the same block copy-pasted. A smell is not a bug; it is a hint to look closer. The check is fixed rules that count lines, parameters, cases and repeats (long method, long parameter list, large class, big switch or if/else chain, long call chains, duplicate blocks, commented-out or unreachable code, the same parameters travelling together). No AI runs on the server, so the same code always gives the same result. Use it before committing or when reviewing a change. Returns findings (smell, line, endLine, detail, confidence high/medium/low, the knowledge-base entry and fixes: refactorings that remove it), summary counts, and a checklist of every other smell in the knowledge base with its triggers, for the ones rules cannot measure (such as Feature Envy: a method that uses another object's data more than its own), which you judge yourself. Next: confirm each finding in context, apply the fixes, or pass the result to the code-smell-review prompt for a written review. Read-only: it never changes code.
Ask your agent
You don’t call quality.smell_check yourself. Say something like this to Claude Code, Cursor or another MCP-connected agent:
- “Check the file I just wrote for code smells”
- “Is my diff getting messy? Anything I should clean up before committing?”
- “Review this function for maintainability problems”
Inputs
| Name | Type | Description |
|---|---|---|
coderequired | string | The code to check, pasted as text: a whole file, one function, or a unified diff (git diff output). For a diff only the added lines are checked, and finding line numbers count within those added lines, not the original file. |
languageoptional | string | Language hint, e.g. "typescript" or "python". Echoed back only; the rules work across brace languages (TS/JS/Java/C#/Go/Kotlin/PHP) and Python. |
pathoptional | string | File path, e.g. "src/orders/order.service.ts". Echoed back on the result and each finding so you can match findings to files when checking several. |
thresholdsoptional | object | Override any rule limit; leave out the rest. Raise a number to be more lenient. Example: { "longMethodLines": 50, "maxParams": 6 }. Defaults: {"longMethodLines":30,"maxParams":4,"largeClassLines":300,"chainDepth":3,"duplicateBlockLines":6,"switchCases":4,"commentRatio":0.3} |
The MCP call
What the agent’s MCP client sends (placeholders in angle brackets):
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "quality.smell_check",
"arguments": {
"code": "<code>"
}
}
}Connect your agent
npx -y @testmaze/mcp init tmt_xxx claude mcp add tm --scope project -- npx -y @testmaze/mcp
Create the token in your Test Maze workspace under Settings → MCP. Setup for Cursor, Cline, Gemini CLI and Codex CLI is shown there too.
More code quality tools
- Suggest a design for a code structure problem
architecture.advise - Search the code-quality guide
kb.search - Read a code-quality guide entry
kb.get