Skip to main content
Glama

ask-qwen

Query Qwen AI to analyze codebases and files, execute code in sandbox mode, and generate explanations with configurable approval settings for safe operations.

Instructions

Query Qwen AI with support for file analysis (@file syntax), codebase exploration, and large context windows. Supports various models and execution modes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesThe query or instruction for Qwen. Use @filename or @directory to include file contents. Example: '@src/ Explain this codebase structure'
modelNoOptional model to use (e.g., 'qwen3-coder-plus'). If not specified, uses the default model (qwen3-coder-plus).
sandboxNoUse sandbox mode (-s flag) to safely test code changes, execute scripts, or run potentially risky operations in an isolated environment
approvalModeNoControl tool execution approval: 'plan' (analyze only), 'default' (prompt for approval), 'auto-edit' (auto-approve edits), 'yolo' (auto-approve all)
yoloNoEnable YOLO mode to automatically approve all tool calls without prompting (equivalent to approvalMode='yolo')
allFilesNoInclude all files in the current directory as context (use with caution for large directories)
debugNoEnable debug mode for more verbose output

Implementation Reference

  • The main execution handler for the 'ask-qwen' tool. Destructures input arguments, validates the prompt, and invokes the Qwen CLI executor with the parameters.
    execute: async (args, onProgress) => {
      const { prompt, model, sandbox, approvalMode, yolo, allFiles, debug } = args;
    
      // Validate prompt
      if (!prompt || !prompt.trim()) {
        throw new Error(ERROR_MESSAGES.NO_PROMPT_PROVIDED);
      }
    
      // Execute Qwen CLI
      const result = await executeQwenCLI({
        prompt,
        model,
        sandbox,
        approvalMode,
        yolo,
        allFiles,
        debug,
        onProgress
      });
    
      return result;
    },
  • Zod schema for input validation of the 'ask-qwen' tool parameters including prompt, model selection, sandbox mode, approval settings, and debug options.
    zodSchema: z.object({
      prompt: z
        .string()
        .min(1)
        .describe(
          "The query or instruction for Qwen. Use @filename or @directory to include file contents. Example: '@src/ Explain this codebase structure'"
        ),
      model: z
        .enum([
          QWEN_MODELS.PRIMARY,
          QWEN_MODELS.FALLBACK,
          QWEN_MODELS.PLUS,
          QWEN_MODELS.TURBO,
          QWEN_MODELS.PRO
        ])
        .optional()
        .describe(
          `Optional model to use (e.g., '${QWEN_MODELS.PRIMARY}'). If not specified, uses the default model (${QWEN_MODELS.PRIMARY}).`
        ),
      sandbox: z
        .boolean()
        .default(false)
        .describe(
          "Use sandbox mode (-s flag) to safely test code changes, execute scripts, or run potentially risky operations in an isolated environment"
        ),
      approvalMode: z
        .enum([
          APPROVAL_MODES.PLAN,
          APPROVAL_MODES.DEFAULT,
          APPROVAL_MODES.AUTO_EDIT,
          APPROVAL_MODES.YOLO
        ])
        .optional()
        .describe(
          "Control tool execution approval: 'plan' (analyze only), 'default' (prompt for approval), 'auto-edit' (auto-approve edits), 'yolo' (auto-approve all)"
        ),
      yolo: z
        .boolean()
        .default(false)
        .describe(
          "Enable YOLO mode to automatically approve all tool calls without prompting (equivalent to approvalMode='yolo')"
        ),
      allFiles: z
        .boolean()
        .default(false)
        .describe(
          "Include all files in the current directory as context (use with caution for large directories)"
        ),
      debug: z
        .boolean()
        .default(false)
        .describe("Enable debug mode for more verbose output")
    }),
  • Prompt schema defining the structure and descriptions for the 'ask-qwen' tool arguments, likely for MCP protocol integration.
      prompt: {
        name: "ask-qwen",
        description:
          "Interact with Qwen AI for code analysis, file exploration, and general queries. Supports @file references for including file contents.",
        arguments: [
          {
            name: "prompt",
            description:
              "Your question or instruction. Use @filename or @directory to reference files.",
            required: true
          },
          {
            name: "model",
            description: `Optional model selection (${QWEN_MODELS.PRIMARY}, ${QWEN_MODELS.TURBO}, etc.)`,
            required: false
          },
          {
            name: "sandbox",
            description: "Enable sandbox mode for safe code execution",
            required: false
          },
          {
            name: "approvalMode",
            description: "Control approval for tool execution (plan/default/auto-edit/yolo)",
            required: false
          }
        ]
      }
    };
  • Registers the askQwenTool ("ask-qwen") along with other tools in the tool registry.
    registerTool(askQwenTool);
    registerTool(pingTool);
    registerTool(helpTool);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'execution modes' and 'large context windows' but lacks critical details: no information on rate limits, authentication needs, response format, error handling, or whether queries are logged/stored. For a complex AI query tool with 7 parameters, this is a significant gap.

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

Conciseness4/5

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

The description is appropriately concise (two sentences) and front-loaded with the core purpose. Every sentence adds value: the first establishes the main function and key features, the second mentions model and execution mode support. No wasted words, though it could be slightly more structured.

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 complex AI query tool with 7 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., text response, structured data), error conditions, or important behavioral constraints. The schema covers parameters well, but the overall context for proper tool invocation is insufficient.

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 the schema already documents all 7 parameters thoroughly. The description adds minimal value beyond the schema, mentioning '@file syntax' and 'various models' but not providing additional context about parameter interactions or advanced usage patterns. Baseline 3 is appropriate when the schema does most of the work.

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 tool's purpose: 'Query Qwen AI with support for file analysis (@file syntax), codebase exploration, and large context windows.' It specifies the verb ('Query') and resource ('Qwen AI') with additional capabilities. However, it doesn't explicitly differentiate from sibling tools like 'Help' or 'ping' beyond the AI query focus.

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

Usage Guidelines3/5

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

The description implies usage context through features like file analysis and codebase exploration, suggesting it's for AI-assisted development tasks. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., 'Help' for server info, 'ping' for connectivity), and doesn't mention prerequisites or exclusions.

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/Jaggerxtrm/qwen-mcp-tool'

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