completeTask
Mark tasks as complete in the Godspeed task application using their unique IDs via the godspeed-mcp server API.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/index.ts:176-187 (handler)The MCP tool handler function for 'completeTask'. It takes a task ID, calls the GodspeedAPI.completeTask method, and returns the JSON stringified result or an error message.async ({ id }) => { try { const result = await godspeedApi.completeTask(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }] }; } }
- src/index.ts:174-174 (schema)Input schema validation for the 'completeTask' tool using Zod: requires a string 'id' parameter.id: z.string()
- src/index.ts:171-188 (registration)Registration of the 'completeTask' MCP tool using server.tool() with name, input schema, and handler function.server.tool( "completeTask", { id: z.string() }, async ({ id }) => { try { const result = await godspeedApi.completeTask(id); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}` }] }; } } );
- src/godspeed.ts:273-275 (helper)Supporting helper method in GodspeedAPI class that completes a task by calling updateTask with is_complete: true.async completeTask(id: string): Promise<ApiResponse<Task>> { return this.updateTask({ id, is_complete: true }); }