Skip to main content
Glama
pholex

Qinglong MCP Server

by pholex

run_subscription

Execute a specific subscription in Qinglong Panel to run scheduled tasks. Provide the subscription ID to trigger task execution and monitor results.

Instructions

运行指定的订阅

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscription_idYes订阅 ID

Implementation Reference

  • Handler function for the 'run_subscription' tool. Retrieves subscription_id, sends PUT request to Qinglong API /open/subscriptions/run, handles response or errors.
    elif tool_name == "run_subscription":
        subscription_id = arguments.get("subscription_id")
        try:
            url = f"{QINGLONG_URL}/open/subscriptions/run"
            headers = {"Authorization": f"Bearer {token}"}
            data = [subscription_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"订阅 {subscription_id} 已成功运行"}]}
            }
        else:
            response = {
                "jsonrpc": "2.0",
                "id": request["id"],
                "error": {"code": -32603, "message": f"运行订阅失败: {result}"}
            }
  • Input schema defining subscription_id as required integer.
    "inputSchema": {
        "type": "object",
        "properties": {
            "subscription_id": {"type": "integer", "description": "订阅 ID"}
        },
        "required": ["subscription_id"]
    }
  • server.py:142-152 (registration)
    Tool registration in the tools/list method, including name, description, and schema.
    {
        "name": "run_subscription",
        "description": "运行指定的订阅",
        "inputSchema": {
            "type": "object",
            "properties": {
                "subscription_id": {"type": "integer", "description": "订阅 ID"}
            },
            "required": ["subscription_id"]
        }
    }

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