Execute AutoGLM Task
autoglm_taskAutomate Android device tasks by sending natural language instructions; the model analyzes the screen and executes actions until the task is done.
Instructions
Execute a task on a connected device using AutoGLM online model.
This tool sends a natural language task description to the AutoGLM online model, which analyzes the current screen state and automatically performs the required actions to complete the task. The model will iteratively capture screenshots, analyze the screen, and execute actions until the task is complete or the maximum steps are reached.
Args:
device_id (string, optional): Target ADB device ID (if not specified, uses the first connected device)
prompt (string): Natural language task description for AutoGLM to execute (1-5000 characters)
max_steps (number, optional): Maximum number of steps to execute (default: 100, range: 1-200)
lang ('cn' | 'en', optional): Language for system prompt and responses (default: 'cn')
How it works:
Captures the current screen via ADB
Sends the screen image and task prompt to AutoGLM online model
The model analyzes the screen and decides on the next action
Executes the action via ADB
Repeats until the task is complete or max_steps is reached
Examples:
Use when: "Open WeChat and send a message to Mom saying hello"
Use when: "Order a coffee from Starbucks app"
Use when: "Navigate to the settings and enable dark mode"
Don't use when: You only need to execute a single known action (use autoglm_execute_action instead)
Error Handling:
Returns "Error: No ADB devices connected" if no device is available
Returns "Error: API authentication failed" if API key is invalid
Returns "Error: Task execution failed" if the task cannot be completed
Returns partial results if the task is interrupted
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Language for system prompt and responses (default: cn) | cn |
| prompt | Yes | Natural language task description for AutoGLM to execute | |
| device_id | No | Target ADB device ID (if not specified, uses the first connected device) | |
| max_steps | No | Maximum number of steps to execute (default: 100) |