list_todos
Retrieve all todo items for the authenticated user to view current tasks and track progress in your todo management system.
Instructions
List all todos for the authenticated user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| authToken | No | Authentication token from Kinde (optional if saved) |
Implementation Reference
- src/server.ts:427-461 (handler)Handler for the 'list_todos' tool: authenticates user via token, queries PostgreSQL for todos belonging to the user ordered by creation date descending, returns JSON list.case 'list_todos': { // 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 "list todos" again`, }, ], }; } const user = await verifyToken(token); if (!user) { return { content: [{ type: 'text', text: 'Error: Invalid authentication token' }], }; } const todos = await sql` SELECT * FROM todos WHERE user_id = ${user.userId} ORDER BY created_at DESC `; return { content: [{ type: 'text', text: JSON.stringify({ success: true, todos }, null, 2) }], }; }
- src/server.ts:243-255 (registration)Registration of the 'list_todos' tool in the listTools response, including name, description, and input schema.{ name: 'list_todos', description: 'List all todos for the authenticated user', inputSchema: { type: 'object', properties: { authToken: { type: 'string', description: 'Authentication token from Kinde (optional if saved)', }, }, }, },
- src/server.ts:246-254 (schema)Input schema definition for the 'list_todos' tool, specifying optional authToken parameter.inputSchema: { type: 'object', properties: { authToken: { type: 'string', description: 'Authentication token from Kinde (optional if saved)', }, }, },