qwen3_code_review
Analyze code for issues and improvements using AI-powered code review. Submit code with language specification to receive detailed feedback on potential bugs, optimizations, and best practices.
Instructions
Review code using Qwen3-Coder
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code to review | |
| language | No | Programming language of the code |
Implementation Reference
- qwen3-mcp-server.js:173-182 (handler)Handler logic for the qwen3_code_review tool. Constructs a detailed prompt for code review and invokes the callQwen3Coder function to get the AI response.case "qwen3_code_review": prompt = `Please review the following ${args.language || 'code'} and provide feedback on code quality, potential bugs, best practices, and suggestions for improvement: \`\`\`${args.language || ''} ${args.code} \`\`\` Please provide a detailed code review with specific suggestions.`; result = await callQwen3Coder(prompt); break;
- qwen3-mcp-server.js:65-78 (schema)Input schema definition for the qwen3_code_review tool, specifying parameters for code and optional language.inputSchema: { type: "object", properties: { code: { type: "string", description: "The code to review" }, language: { type: "string", description: "Programming language of the code" } }, required: ["code"] }
- qwen3-mcp-server.js:62-79 (registration)Tool registration in the ListTools response, defining name, description, and input schema for qwen3_code_review.{ name: "qwen3_code_review", description: "Review code using Qwen3-Coder", inputSchema: { type: "object", properties: { code: { type: "string", description: "The code to review" }, language: { type: "string", description: "Programming language of the code" } }, required: ["code"] } },
- qwen3-mcp-server.js:25-56 (helper)Shared helper function callQwen3Coder that spawns Ollama process to run qwen3-coder model with the given prompt, used by all tools including qwen3_code_review.async function callQwen3Coder(prompt, options = {}) { return new Promise((resolve, reject) => { const ollamaProcess = spawn('ollama', ['run', 'qwen3-coder:30b', prompt], { stdio: ['pipe', 'pipe', 'pipe'] }); let output = ''; let error = ''; ollamaProcess.stdout.on('data', (data) => { output += data.toString(); }); ollamaProcess.stderr.on('data', (data) => { error += data.toString(); }); ollamaProcess.on('close', (code) => { if (code === 0) { resolve(output.trim()); } else { reject(new Error(`Ollama process exited with code ${code}: ${error}`)); } }); // Set timeout for long-running requests setTimeout(() => { ollamaProcess.kill(); reject(new Error('Request timeout')); }, options.timeout || 120000); // 2 minutes default timeout }); }