server_run_task
Manually trigger a scheduled task immediately on a server. Use this tool to run tasks without waiting for their scheduled time.
Instructions
Manually trigger a scheduled task immediately
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"server_id": "<server_id>",
"task_id": "<task_id>"
},
"name": "server_run_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server_id | Yes | Server ID or UUID | |
| task_id | Yes | Task ID to run |
Implementation Reference
- src/tools/server-tasks.ts:118-136 (handler)The tool 'server_run_task' is registered and implemented within 'registerServerTaskTools' in 'src/tools/server-tasks.ts'. The handler makes a POST request to the Crafty API to trigger the task.
server.tool( "server_run_task", "Manually trigger a scheduled task immediately", { server_id: z.string().describe("Server ID or UUID"), task_id: z.string().describe("Task ID to run"), }, async ({ server_id, task_id }) => { try { const data = await client.post( `/servers/${server_id}/tasks/${task_id}/run` ); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true }; } } );