qwen
Runs an AI code assistant non-interactively to answer coding questions, analyze code, and delegate tasks with configurable approval modes and multi-turn sessions.
Instructions
Run the Qwen Code CLI non-interactively for AI assistance. Read-only (approval mode "plan") unless configured or asked otherwise.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "qwen"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use (defaults to QWEN_MCP_DEFAULT_MODEL, else Qwen Code’s own default) | |
| prompt | Yes | The coding task, question, or analysis request | |
| sessionId | No | Optional caller-chosen ID for a multi-turn conversation. Calls with the same ID continue the same Qwen session, in the working directory of the first call. | |
| maxWallTime | No | Wall-clock budget for this run, e.g. 90, 30s, 5m, 1.5h (defaults to QWEN_MCP_MAX_WALL_TIME, else 15m) | |
| approvalMode | No | plan: analyze only, no edits or commands (default). default: edits and commands need approval, and a headless run has nobody to give it. auto-edit: file edits approved. auto: a classifier approves safe actions. yolo: everything approved. | |
| resetSession | No | Forget the Qwen session behind sessionId and start a fresh one with this request | |
| workingDirectory | No | Directory to run Qwen Code in. Fixed by the first call of a session. | |
| appendSystemPrompt | No | Extra instructions appended to the system prompt |