list_subscriptions
Retrieve all subscription lists from Qinglong Panel to monitor and manage scheduled tasks.
Instructions
查询青龙面板中的所有订阅列表
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_subscriptions"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:413-453 (handler)The handler logic for the 'list_subscriptions' tool. It authenticates with a Bearer token, makes a GET request to the Qinglong panel's /open/subscriptions endpoint, parses the response, formats the subscription list (ID, name, URL, type, schedule, status) into a readable text output, and returns it in the MCP response format. Handles errors appropriately.
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)Registration of the 'list_subscriptions' tool in the tools/list MCP method response. Includes name, description, and empty input schema (no parameters required).
{ "name": "list_subscriptions", "description": "查询青龙面板中的所有订阅列表", "inputSchema": { "type": "object", "properties": {} } }, - server.py:137-140 (schema)Input schema for 'list_subscriptions' tool: an empty object, indicating no input parameters are required.
"inputSchema": { "type": "object", "properties": {} }