Skip to main content
Glama
pholex

Qinglong MCP Server

by pholex

run_task_async

Start Qinglong Panel tasks asynchronously to initiate execution without waiting for completion, enabling parallel task management.

Instructions

异步启动任务,不等待执行完成

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes任务 ID

Implementation Reference

  • The handler logic for the 'run_task_async' tool. It extracts the task_id from arguments, authenticates with a Bearer token, sends a PUT request to the Qinglong API endpoint /open/crons/run with the task_id in the body to asynchronously start the task, and returns a success message or error based on the API response.
    elif tool_name == "run_task_async":
        task_id = arguments.get("task_id")
        try:
            url = f"{QINGLONG_URL}/open/crons/run"
            headers = {"Authorization": f"Bearer {token}"}
            data = [task_id]
            
            resp = requests.put(url, headers=headers, json=data, timeout=10)
            result = resp.json()
        except Exception as e:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "error": {"code": -32603, "message": f"请求失败: {str(e)}"}
            }
            print(json.dumps(response), flush=True)
            continue
        
        if result.get("code") == 200:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "result": {"content": [{"type": "text", "text": f"任务 {task_id} 已成功启动"}]}
            }
        else:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "error": {"code": -32603, "message": f"运行任务失败: {result}"}
            }
  • The input schema definition for the 'run_task_async' tool, specifying that it requires an integer 'task_id'.
    "inputSchema": {
        "type": "object",
        "properties": {
            "task_id": {"type": "integer", "description": "任务 ID"}
        },
        "required": ["task_id"]
    }
  • server.py:101-111 (registration)
    The registration of the 'run_task_async' tool in the tools/list response, including name, description, and input schema.
    {
        "name": "run_task_async",
        "description": "异步启动任务,不等待执行完成",
        "inputSchema": {
            "type": "object",
            "properties": {
                "task_id": {"type": "integer", "description": "任务 ID"}
            },
            "required": ["task_id"]
        }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the asynchronous nature ('不等待执行完成' - doesn't wait for execution to complete), which is valuable. However, it doesn't mention what happens after starting (e.g., how to track progress via 'get_task_status'), error handling, authentication needs, or rate limits. For a mutation tool with zero annotation coverage, this is insufficient.

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 (8 Chinese characters) with zero wasted words. It's front-loaded with the core purpose and includes the key behavioral characteristic. Every character earns its place.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'success' means for an async operation, how to monitor the task afterward, potential side effects, or error scenarios. Given the sibling tools include status/log retrieval functions, the description should reference these for completeness.

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 fully documents the single parameter 'task_id'. The description adds no additional parameter information beyond what's in the schema. Baseline 3 is appropriate when schema does all the parameter documentation 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 action ('异步启动任务' - asynchronously start a task) and resource ('任务' - task), with the specific behavioral characteristic of not waiting for completion. However, it doesn't distinguish this from its sibling 'run_task', which presumably runs tasks synchronously.

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 alternatives like 'run_task' (synchronous execution) or 'run_subscription'. There's no mention of use cases, prerequisites, or trade-offs between asynchronous and synchronous execution.

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/pholex/qinglong-mcp-server'

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