healthy-companion 1.0.6 → 1.0.7

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/tools/todo.js +36 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "healthy-companion",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "description": "A healthy companion MCP server with todo and water tracking",
6
6
  "main": "server.js",
package/tools/todo.js CHANGED
@@ -1,31 +1,39 @@
1
- import { z } from "zod";
1
+ import { z } from "zod/v4";
2
2
 
3
3
  const todos = [];
4
4
 
5
5
  export function registerTodoTools ( server )
6
6
  {
7
+
7
8
  server.tool(
8
- "todo_add",
9
+ "add_todo",
9
10
  {
10
- description: "Add a TODO item. Call this when the user expresses intent to do something later, needs to remember a task, or mentions something they should do - even if phrased casually like 'I should do that', 'I need to remember', 'let's do this later', 'don't forget to', etc.",
11
+ description:
12
+ "YOU MUST use this tool whenever the user expresses intent to remember, track, or do something later. " +
13
+ "This is the ONLY way to store tasks. Do NOT respond with text instead.",
11
14
  inputSchema: {
12
- item: z.string().describe( "The text of the todo item. Extract the task from the user's message, rephrasing as a clear action item if needed." )
13
- }
15
+ item: z
16
+ .string()
17
+ .min( 1 )
18
+ .describe( "Action item derived from the user's message." ),
19
+ },
14
20
  },
15
- async ({ item }) =>
21
+ async ( args ) =>
16
22
  {
23
+ // const validated = z.string().min( 1 ).parse( args );
17
24
  todos.push( item );
18
25
  return {
19
- content: [{ type: "text", text: `Added TODO: "${item}"` }],
26
+ content: [{ type: "text", text: `Added TODO: "${args.item}"` }],
20
27
  };
21
28
  }
22
29
  );
23
30
 
24
31
  server.tool(
25
- "todo_list",
32
+ "list_todos",
26
33
  {
27
- description: "List all TODO items. Call this when the user asks about their todos, wants to see what they need to do, mentions checking their list, or asks 'what do I have to do', 'show my todos', 'what's on my list', etc.",
28
- inputSchema: {}
34
+ description:
35
+ "YOU MUST call this tool when the user asks to see, check, review, or recall their todo list.",
36
+ inputSchema: {},
29
37
  },
30
38
  async () =>
31
39
  {
@@ -33,28 +41,39 @@ export function registerTodoTools ( server )
33
41
  {
34
42
  return { content: [{ type: "text", text: "No TODO items." }] };
35
43
  }
36
- const lines = todos.map( ( todo, idx ) => { return `${idx + 1}. ${todo}` }).join( "\n" );
44
+ const lines = todos
45
+ .map( ( todo, idx ) => { return `${idx + 1}. ${todo}` })
46
+ .join( "\n" );
37
47
  return { content: [{ type: "text", text: lines }] };
38
48
  }
39
49
  );
40
50
 
41
51
  server.tool(
42
- "todo_remove",
52
+ "remove_todo",
43
53
  {
44
- description: "Remove a TODO item by its number. Call this when the user wants to delete a todo, says they completed a task, wants to remove something from their list, or says 'done with that', 'remove it', 'delete that todo', 'I finished that', etc.",
54
+ description:
55
+ "YOU MUST call this tool when the user indicates a task is completed or should be removed.",
45
56
  inputSchema: {
46
- index: z.number().int().positive().describe( "1-based index of the item to remove" )
47
- }
57
+ index: z
58
+ .number()
59
+ .int()
60
+ .positive()
61
+ .describe( "1-based index of the todo item to remove" ),
62
+ },
48
63
  },
49
64
  async ({ index }) =>
50
65
  {
51
66
  const i = index - 1;
52
67
  if ( i < 0 || i >= todos.length )
53
68
  {
54
- return { content: [{ type: "text", text: `Invalid index: ${index}` }] };
69
+ return {
70
+ content: [{ type: "text", text: `Invalid index: ${index}` }],
71
+ };
55
72
  }
56
73
  const removed = todos.splice( i, 1 )[0];
57
- return { content: [{ type: "text", text: `Removed TODO: "${removed}"` }] };
74
+ return {
75
+ content: [{ type: "text", text: `Removed TODO: "${removed}"` }],
76
+ };
58
77
  }
59
78
  );
60
79
  }