move_task
Reposition a task within a dartboard or move it to a different dartboard, with ordering by index or relative placement.
Instructions
Move/reposition a task within a dartboard or to a different dartboard. Supports ordering by index or relative to another task.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dart_id | Yes | Task dart_id (also accepts "id" or "task_id") | |
| dartboard | No | Target dartboard (dart_id or name) - moves task to different dartboard | |
| order | No | Position index in dartboard (0-based) | |
| after_id | No | Place task after this task dart_id | |
| before_id | No | Place task before this task dart_id |
Implementation Reference
- src/tools/move_task.ts:26-86 (handler)Main handler for the move_task tool. Validates input, resolves dart_id aliases, validates dartboard if provided, then calls DartClient.moveTask and returns the result.
export async function handleMoveTask(input: MoveTaskInput): Promise<MoveTaskOutput> { const DART_TOKEN = process.env.DART_TOKEN; if (!DART_TOKEN) { throw new DartAPIError( 'DART_TOKEN environment variable is required. Get your token from: https://app.dartai.com/?settings=account', 401 ); } // Validate input if (!input || typeof input !== 'object') { throw new ValidationError('Input must be an object', 'input'); } // Accept id, task_id, or taskId as aliases for dart_id input.dart_id = resolveDartId(input as unknown as Record<string, unknown>); // At least one positioning option should be provided if (input.dartboard === undefined && input.order === undefined && input.after_id === undefined && input.before_id === undefined) { throw new ValidationError( 'At least one of dartboard, order, after_id, or before_id must be provided', 'positioning' ); } // Validate dartboard if provided let resolvedDartboard: string | undefined; if (input.dartboard !== undefined) { const config = await handleGetConfig({ cache_bust: false }); const dartboard = findDartboard(config.dartboards, input.dartboard); if (!dartboard) { const dartboardNames = getDartboardNames(config.dartboards); throw new ValidationError( `Invalid dartboard: "${input.dartboard}" not found. Available: ${dartboardNames.slice(0, 5).join(', ')}`, 'dartboard', dartboardNames ); } resolvedDartboard = typeof dartboard === 'string' ? dartboard : dartboard.dart_id; } const client = new DartClient({ token: DART_TOKEN }); const task = await client.moveTask({ dart_id: input.dart_id.trim(), dartboard: resolvedDartboard, order: input.order, after_id: input.after_id, before_id: input.before_id, }); return { dart_id: task.dart_id, dartboard: task.dartboard || resolvedDartboard || '', task, url: `https://app.dartai.com/task/${task.dart_id}`, }; } - src/types/index.ts:824-830 (schema)Input type for move_task: dart_id is required; dartboard, order, after_id, before_id are optional positioning parameters.
export interface MoveTaskInput { dart_id: string; dartboard?: string; order?: number; after_id?: string; before_id?: string; } - src/types/index.ts:832-837 (schema)Output type for move_task: returns dart_id, dartboard, full task object, and a URL to the task.
export interface MoveTaskOutput { dart_id: string; dartboard: string; task: DartTask; url: string; } - src/index.ts:847-875 (registration)Registration of the move_task tool in the MCP server tool list with name, description, and input schema.
{ name: 'move_task', description: 'Move/reposition a task within a dartboard or to a different dartboard. Supports ordering by index or relative to another task.', inputSchema: { type: 'object', properties: { dart_id: { type: 'string', description: 'Task dart_id (also accepts "id" or "task_id")', }, dartboard: { type: 'string', description: 'Target dartboard (dart_id or name) - moves task to different dartboard', }, order: { type: 'integer', description: 'Position index in dartboard (0-based)', }, after_id: { type: 'string', description: 'Place task after this task dart_id', }, before_id: { type: 'string', description: 'Place task before this task dart_id', }, }, required: ['dart_id'], }, - src/index.ts:1208-1218 (registration)Routing case in the main request handler that calls handleMoveTask when the tool name is 'move_task'.
case 'move_task': { const result = await handleMoveTask((args || {}) as any); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }