list_subscriptions
Retrieve all subscription lists from Qinglong Panel to view scheduled tasks and monitor their execution status.
Instructions
查询青龙面板中的所有订阅列表
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:413-453 (handler)Executes the list_subscriptions tool by querying the Qinglong API for subscriptions, formatting the list into a readable text output including ID, name, URL, type, schedule, and status.elif tool_name == "list_subscriptions": try: url = f"{QINGLONG_URL}/open/subscriptions" 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: subscriptions = result["data"] if isinstance(result["data"], list) else [] subscriptions.sort(key=lambda x: x.get('id', 0)) total = len(subscriptions) output = f"青龙面板: {QINGLONG_URL}\n共 {total} 个订阅:\n\n" for sub in subscriptions: output += f"ID: {sub.get('id')}\n" output += f"名称: {sub.get('name')}\n" output += f"URL: {sub.get('url')}\n" output += f"类型: {sub.get('type')}\n" output += f"定时: {sub.get('schedule')}\n" output += f"状态: {'启用' if sub.get('is_disabled') == 0 else '禁用'}\n" output += "-" * 50 + "\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:134-141 (registration)Registers the list_subscriptions tool in the tools/list response, providing name, description, and empty input schema (no parameters required).{ "name": "list_subscriptions", "description": "查询青龙面板中的所有订阅列表", "inputSchema": { "type": "object", "properties": {} } },
- server.py:134-141 (schema)Defines the input schema for list_subscriptions: an empty object (no input parameters).{ "name": "list_subscriptions", "description": "查询青龙面板中的所有订阅列表", "inputSchema": { "type": "object", "properties": {} } },