Suggest a design for a code structure problem
architecture.adviseReadsOnly looks things up; never changes your workspace.What it does
Suggests ways to structure code for a design problem you describe in plain words, such as "three payment providers with different APIs", "undo for editor actions" or "one class that changes for every feature". Use it before a bigger change or when code keeps getting harder to extend. It returns a ranked shortlist (candidates) of design patterns (proven shapes like Strategy or Adapter, from the Gang of Four book) and refactorings (small safe changes like Extract Method, from Martin Fowler), each with name, intent, whenToUse, tradeoffs, related entries, a score and the words that matched, plus howToDecide guidance. Ranking is fixed keyword matching against each entry's curated triggers, no AI on the server: it narrows the options, and you (the agent) still pick one against the real code, preferring the smallest change that removes the problem. No matches means re-phrase with the symptom you see in code. Next: kb.get to read a candidate in full, or the architecture-review prompt to write up a justified recommendation.
Ask your agent
You don’t call architecture.advise yourself. Say something like this to Claude Code, Cursor or another MCP-connected agent:
- “How should I structure support for Stripe, PayPal and Razorpay without a giant if/else?”
- “This service class keeps growing, what design would help?”
- “What is a clean way to add undo to my editor?”
Inputs
| Name | Type | Description |
|---|---|---|
problemrequired | string | The design problem in plain language, including what you see in the code, e.g. "big switch on order type in every service, adding a type touches 6 files". |
constraintsoptional | string | Limits on the solution, e.g. "TypeScript, NestJS, no new dependencies". Matched as extra keywords together with problem, and echoed back; it does not filter candidates. |
kindsoptional | enum[] | Which kinds of entry to consider, e.g. ["refactoring"] for small changes only. Default: ["pattern", "refactoring"]. |
limitoptional | integer | Most candidates to return (1–10, default 5). |
The MCP call
What the agent’s MCP client sends (placeholders in angle brackets):
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "architecture.advise",
"arguments": {
"problem": "<problem>"
}
}
}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
- Check code for smells
quality.smell_check - Search the code-quality guide
kb.search - Read a code-quality guide entry
kb.get