Skip to main content
Glama

run_subscription

Execute scheduled tasks from Qinglong Panel by running a specific subscription using its ID to trigger automated workflows.

Instructions

运行指定的订阅

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
subscription_idYes订阅 ID

Implementation Reference

  • Handler implementation for the 'run_subscription' tool. It extracts the subscription_id from arguments, authenticates with a Bearer token, sends a PUT request to the Qinglong API endpoint /open/subscriptions/run with the ID, and returns a success message or error based on the API response.
    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 definition for the 'run_subscription' tool, specifying that it requires an integer 'subscription_id'.
    "inputSchema": { "type": "object", "properties": { "subscription_id": {"type": "integer", "description": "订阅 ID"} }, "required": ["subscription_id"] }
  • server.py:142-152 (registration)
    Registration of the 'run_subscription' tool in the tools/list method response, including name, description, and input 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