Skip to main content
Glama
pholex

Qinglong MCP Server

by pholex

get_task_status

Check the execution status of scheduled tasks in Qinglong Panel by providing the task ID to monitor progress and results.

Instructions

获取青龙面板中指定任务的执行状态

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYes任务 ID

Implementation Reference

  • Handler implementation for the get_task_status tool. Retrieves task status from Qinglong API endpoint /open/crons/{task_id}, maps status codes to human-readable text, and constructs a formatted output with task details including name, status, disabled/pinned flags, last run time, and last execution time.
    elif tool_name == "get_task_status":
        task_id = arguments.get("task_id")
        try:
            url = f"{QINGLONG_URL}/open/crons/{task_id}"
            headers = {"Authorization": f"Bearer {token}"}
            resp = requests.get(url, headers=headers, 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:
            cron = result["data"]
            status_map = {0: "运行中", 1: "空闲", 2: "禁用"}
            status = status_map.get(cron.get("status"), "未知")
            
            output = f"任务 {task_id} 状态信息:\n\n"
            output += f"名称: {cron.get('name')}\n"
            output += f"状态: {status}\n"
            output += f"是否禁用: {'是' if cron.get('isDisabled') == 1 else '否'}\n"
            output += f"是否置顶: {'是' if cron.get('isPinned') == 1 else '否'}\n"
            last_running = cron.get('last_running_time')
            output += f"上次运行时长: {last_running}秒\n" if last_running else "上次运行时长: 未运行\n"
            output += f"最后执行时间: {cron.get('last_execution_time', '未执行')}\n"
            
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "result": {"content": [{"type": "text", "text": output}]}
            }
        else:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "error": {"code": -32603, "message": f"获取任务状态失败: {result}"}
            }
  • server.py:123-133 (registration)
    Registration of the get_task_status tool in the tools/list method response, including name, description, and input schema requiring a task_id integer.
    {
        "name": "get_task_status",
        "description": "获取青龙面板中指定任务的执行状态",
        "inputSchema": {
            "type": "object",
            "properties": {
                "task_id": {"type": "integer", "description": "任务 ID"}
            },
            "required": ["task_id"]
        }
    },
  • Input schema for get_task_status tool: requires a single integer property 'task_id'.
    "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 but offers minimal behavioral insight. It states the action ('get status') but doesn't disclose traits like whether it's read-only, requires authentication, has rate limits, or what the response format might be. This is inadequate for a tool with zero annotation coverage.

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 a single, efficient sentence in Chinese that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'execution status' entails (e.g., pending, running, success, failure), return values, or error handling, leaving significant gaps for a tool that interacts with task management.

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?

The schema description coverage is 100%, with the single parameter 'task_id' documented as '任务 ID' (task ID). The description adds no additional meaning beyond this, such as format examples or constraints, so it meets the baseline for high schema coverage without compensating value.

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 verb ('获取' meaning 'get') and resource ('青龙面板中指定任务的执行状态' meaning 'execution status of specified task in Qinglong panel'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_task_logs' or 'list_qinglong_tasks', which might also involve task information retrieval.

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. It doesn't mention prerequisites, when-not scenarios, or comparisons to siblings like 'get_task_logs' (for logs) or 'list_qinglong_tasks' (for listing tasks), leaving usage context implied at best.

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