Skip to main content
Glama
keithah

Qwen3-Coder MCP Server

qwen3_code_fix

Fix bugs in code by analyzing error messages and providing corrected programming solutions across multiple languages.

Instructions

Fix bugs in code using Qwen3-Coder

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe buggy code to fix
errorNoError message or description of the bug
languageNoProgramming language of the code

Implementation Reference

  • Handler logic for the 'qwen3_code_fix' tool: constructs a specific prompt including the buggy code, optional error message, and language, then invokes the callQwen3Coder helper to get the fix from the Qwen3-Coder model.
          case "qwen3_code_fix":
            prompt = `Fix the following ${args.language || 'code'} that has a bug:
    
    \`\`\`${args.language || ''}
    ${args.code}
    \`\`\`
    
    ${args.error ? `Error/Issue: ${args.error}` : ''}
    
    Please provide the corrected code with explanations of what was wrong and how it was fixed.`;
            result = await callQwen3Coder(prompt);
            break;
  • Input schema for the qwen3_code_fix tool, specifying required 'code' parameter and optional 'error' and 'language'.
    inputSchema: {
      type: "object",
      properties: {
        code: {
          type: "string",
          description: "The buggy code to fix"
        },
        error: {
          type: "string",
          description: "Error message or description of the bug"
        },
        language: {
          type: "string",
          description: "Programming language of the code"
        }
      },
      required: ["code"]
    }
  • Registration of the qwen3_code_fix tool within the listTools response, defining name, description, and input schema.
    {
      name: "qwen3_code_fix",
      description: "Fix bugs in code using Qwen3-Coder",
      inputSchema: {
        type: "object",
        properties: {
          code: {
            type: "string",
            description: "The buggy code to fix"
          },
          error: {
            type: "string",
            description: "Error message or description of the bug"
          },
          language: {
            type: "string",
            description: "Programming language of the code"
          }
        },
        required: ["code"]
      }
    },
  • Helper function that spawns an Ollama process to run the 'qwen3-coder:30b' model with the given prompt, capturing output and handling errors/timeouts. Used by all tools including qwen3_code_fix.
    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
      });
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool fixes bugs but doesn't describe how (e.g., whether it modifies code in-place, returns corrected code, requires specific permissions, has rate limits, or handles partial fixes). The phrase 'using Qwen3-Coder' hints at an underlying model but doesn't clarify operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise (5 words) and front-loaded with the core purpose. Every word earns its place: 'Fix bugs' (action), 'in code' (resource), 'using Qwen3-Coder' (method). There's no wasted language or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a code-fixing tool with 3 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what constitutes a successful fix, whether it returns corrected code or just suggestions, error handling, or limitations. The agent lacks critical context about the tool's operation and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds no additional parameter semantics beyond what's already in the schema (code, error, language). It doesn't explain relationships between parameters or provide examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Fix bugs') and resource ('code using Qwen3-Coder'), making the purpose immediately understandable. It distinguishes from siblings by focusing on bug fixing rather than explanation, generation, optimization, or review. However, it doesn't specify what types of bugs or scope of fixes, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus the sibling tools (explain, generate, optimize, review). It doesn't indicate whether it's for runtime errors, logical bugs, syntax issues, or specific scenarios. Without any usage context or alternatives mentioned, the agent must infer when this tool is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/keithah/qwen3-coder-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server