lystbot 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/mcp.js +17 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lystbot",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "mcpName": "io.github.TourAround/lystbot",
5
5
  "description": "LystBot CLI - Manage your lists from the terminal",
6
6
  "main": "src/index.js",
package/src/mcp.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const { McpServer } = require('@modelcontextprotocol/sdk/server/mcp.js');
2
2
  const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
3
+ const { z } = require('zod');
3
4
  const config = require('./config');
4
5
 
5
6
  // --- API helper (non-exiting version for MCP) ---
@@ -70,7 +71,7 @@ async function startMcpServer() {
70
71
  });
71
72
 
72
73
  server.tool('get_list', 'Get a list with all its items', {
73
- list: { type: 'string', description: 'List name or ID' },
74
+ list: z.string().describe('List name or ID'),
74
75
  }, async ({ list: query }) => {
75
76
  const all = await api('GET', '/lists');
76
77
  const match = findList(all.lists || all, query);
@@ -97,9 +98,9 @@ async function startMcpServer() {
97
98
  });
98
99
 
99
100
  server.tool('create_list', 'Create a new list', {
100
- title: { type: 'string', description: 'List title' },
101
- type: { type: 'string', description: 'List type: shopping, todo, packing, or generic (default: generic)' },
102
- emoji: { type: 'string', description: 'List emoji (optional, auto-picked if omitted)' },
101
+ title: z.string().describe('List title'),
102
+ type: z.string().optional().describe('List type: shopping, todo, packing, or generic (default: generic)'),
103
+ emoji: z.string().optional().describe('List emoji (optional, auto-picked if omitted)'),
103
104
  }, async ({ title, type, emoji }) => {
104
105
  const id = uuid();
105
106
  if (!emoji) {
@@ -116,7 +117,7 @@ async function startMcpServer() {
116
117
  });
117
118
 
118
119
  server.tool('delete_list', 'Delete a list', {
119
- list: { type: 'string', description: 'List name or ID' },
120
+ list: z.string().describe('List name or ID'),
120
121
  }, async ({ list: query }) => {
121
122
  const all = await api('GET', '/lists');
122
123
  const match = findList(all.lists || all, query);
@@ -126,14 +127,13 @@ async function startMcpServer() {
126
127
  });
127
128
 
128
129
  server.tool('add_items', 'Add one or more items to a list', {
129
- list: { type: 'string', description: 'List name or ID' },
130
- items: { type: 'string', description: 'Items to add, separated by comma+space or semicolon. Example: "Milk, Eggs, Butter"' },
130
+ list: z.string().describe('List name or ID'),
131
+ items: z.string().describe('Items to add, separated by comma+space or semicolon. Example: "Milk, Eggs, Butter"'),
131
132
  }, async ({ list: query, items: itemsStr }) => {
132
133
  const all = await api('GET', '/lists');
133
134
  const match = findList(all.lists || all, query);
134
135
  if (!match) throw new Error(`List "${query}" not found`);
135
136
 
136
- // Split on ", " or ";"
137
137
  const texts = itemsStr.split(/;\s*|,\s+/).map(s => s.trim()).filter(Boolean);
138
138
  const added = [];
139
139
 
@@ -147,8 +147,8 @@ async function startMcpServer() {
147
147
  });
148
148
 
149
149
  server.tool('check_item', 'Check off (complete) an item', {
150
- list: { type: 'string', description: 'List name or ID' },
151
- item: { type: 'string', description: 'Item text (fuzzy match)' },
150
+ list: z.string().describe('List name or ID'),
151
+ item: z.string().describe('Item text (fuzzy match)'),
152
152
  }, async ({ list: query, item: itemQuery }) => {
153
153
  const all = await api('GET', '/lists');
154
154
  const match = findList(all.lists || all, query);
@@ -166,8 +166,8 @@ async function startMcpServer() {
166
166
  });
167
167
 
168
168
  server.tool('uncheck_item', 'Uncheck (reopen) an item', {
169
- list: { type: 'string', description: 'List name or ID' },
170
- item: { type: 'string', description: 'Item text (fuzzy match)' },
169
+ list: z.string().describe('List name or ID'),
170
+ item: z.string().describe('Item text (fuzzy match)'),
171
171
  }, async ({ list: query, item: itemQuery }) => {
172
172
  const all = await api('GET', '/lists');
173
173
  const match = findList(all.lists || all, query);
@@ -185,8 +185,8 @@ async function startMcpServer() {
185
185
  });
186
186
 
187
187
  server.tool('remove_item', 'Remove an item from a list', {
188
- list: { type: 'string', description: 'List name or ID' },
189
- item: { type: 'string', description: 'Item text (fuzzy match)' },
188
+ list: z.string().describe('List name or ID'),
189
+ item: z.string().describe('Item text (fuzzy match)'),
190
190
  }, async ({ list: query, item: itemQuery }) => {
191
191
  const all = await api('GET', '/lists');
192
192
  const match = findList(all.lists || all, query);
@@ -204,7 +204,7 @@ async function startMcpServer() {
204
204
  });
205
205
 
206
206
  server.tool('clear_checked', 'Remove all checked (completed) items from a list', {
207
- list: { type: 'string', description: 'List name or ID' },
207
+ list: z.string().describe('List name or ID'),
208
208
  }, async ({ list: query }) => {
209
209
  const all = await api('GET', '/lists');
210
210
  const match = findList(all.lists || all, query);
@@ -215,7 +215,7 @@ async function startMcpServer() {
215
215
  });
216
216
 
217
217
  server.tool('share_list', 'Generate a share code for a list', {
218
- list: { type: 'string', description: 'List name or ID' },
218
+ list: z.string().describe('List name or ID'),
219
219
  }, async ({ list: query }) => {
220
220
  const all = await api('GET', '/lists');
221
221
  const match = findList(all.lists || all, query);
@@ -226,7 +226,7 @@ async function startMcpServer() {
226
226
  });
227
227
 
228
228
  server.tool('join_list', 'Join a shared list using a share code', {
229
- code: { type: 'string', description: 'The share code' },
229
+ code: z.string().describe('The share code'),
230
230
  }, async ({ code }) => {
231
231
  const data = await api('POST', '/lists/join', { share_code: code });
232
232
  return { content: [{ type: 'text', text: `Joined list: ${data.emoji || '📋'} ${data.title || data.list_id}` }] };