update_todo
Modify existing todo items by updating their title, description, or completion status to keep task lists current and organized.
Instructions
Update an existing todo item
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| authToken | Yes | Authentication token from Kinde | |
| completed | No | Completion status of the todo | |
| description | No | New description for the todo | |
| title | No | New title for the todo | |
| todoId | Yes | ID of the todo to update |
Implementation Reference
- src/server.ts:629-682 (handler)Handler for the 'update_todo' tool. Lists the user's todos and prompts for the todo ID and new details to update interactively. Does not perform the update in this call; expects parameters in subsequent interactions.case 'update_todo': { // Try to get token from args or stored token let token = args?.authToken as string; if (!token) { token = getStoredToken() || ''; } if (!token) { return { content: [ { type: 'text', text: `❌ No authentication token found. Please:\n1. Type "login" to get the authentication URL\n2. Complete login at http://localhost:3000\n3. Copy your token and use "save_token" to store it\n4. Then try "update todo" again`, }, ], }; } const user = await verifyToken(token); if (!user) { return { content: [{ type: 'text', text: 'Error: Invalid authentication token' }], }; } // Get user's todos to show them const todos = await sql` SELECT * FROM todos WHERE user_id = ${user.userId} ORDER BY created_at DESC `; if (todos.length === 0) { return { content: [{ type: 'text', text: '❌ No todos found. Create a todo first!' }], }; } let todoList = '📋 **Your Todos:**\n\n'; todos.forEach((todo, index) => { todoList += `${index + 1}. **ID: ${todo.id}** - ${todo.title}\n`; if (todo.description) todoList += ` Description: ${todo.description}\n`; todoList += ` Status: ${todo.completed ? '✅ Completed' : '⏳ Pending'}\n\n`; }); return { content: [ { type: 'text', text: `${todoList}**Which todo would you like to update?**\n\nPlease respond with the todo ID and new details in this format:\n\`\`\`\ntodoId: 1\ntitle: New title (optional)\ndescription: New description (optional)\ncompleted: true (optional)\n\`\`\``, }, ], }; }
- src/server.ts:309-321 (registration)Registration of the 'update_todo' tool in the ListTools response, including its description and input schema.{ name: 'update_todo', description: 'Update an existing todo item with interactive prompts', inputSchema: { type: 'object', properties: { authToken: { type: 'string', description: 'Authentication token from Kinde (optional if saved)', }, }, }, },
- src/server.ts:309-321 (schema)Input schema definition for the 'update_todo' tool, specifying optional authToken parameter.{ name: 'update_todo', description: 'Update an existing todo item with interactive prompts', inputSchema: { type: 'object', properties: { authToken: { type: 'string', description: 'Authentication token from Kinde (optional if saved)', }, }, }, },