healthy-companion 1.0.5 → 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 (3) hide show
  1. package/README.md +14 -14
  2. package/package.json +1 -1
  3. package/tools/todo.js +44 -15
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # Healthy Companion
1
+ # 🌿 Healthy Companion
2
2
 
3
- A lightweight MCP server for tracking todos and water intake. Built with the Model Context Protocol SDK.
3
+ A lightweight MCP server for tracking todos.
4
4
 
5
- ## Setup
5
+ ## 🚀 Setup
6
6
 
7
- ### Kilo Code
7
+ ### 🔧 Kilo Code
8
8
 
9
9
  Add to your Kilo Code MCP settings (`.kilocode/mcp.json`):
10
10
 
@@ -19,18 +19,18 @@ Add to your Kilo Code MCP settings (`.kilocode/mcp.json`):
19
19
  }
20
20
  ```
21
21
 
22
- ## Tools
22
+ ## 🛠️ Tools
23
23
 
24
- | Tool | Description |
25
- | ------------- | ----------------------- |
26
- | `todo_add` | Add a todo item |
27
- | `todo_list` | List all todos |
28
- | `todo_remove` | Remove a todo by number |
24
+ | Tool | Description |
25
+ | ------------- | ------------------------- |
26
+ | `todo_add` | Add a todo item |
27
+ | `todo_list` | 📋 List all todos |
28
+ | `todo_remove` | 🗑️ Remove a todo by number |
29
29
 
30
- ## Usage
30
+ ## 💬 Usage
31
31
 
32
32
  Just ask AI:
33
33
 
34
- - "Add a todo: buy groceries"
35
- - "Show my todos"
36
- - "Remove todo 2"
34
+ - "Add a todo: buy groceries"
35
+ - 📋 "Show my todos"
36
+ - 🗑️ "Remove todo 2"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "healthy-companion",
3
- "version": "1.0.5",
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,50 +1,79 @@
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 a TODO item",
10
- { item: z.string().describe( "The text of the todo item" ) },
11
- async ({ item }) =>
9
+ "add_todo",
10
+ {
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.",
14
+ inputSchema: {
15
+ item: z
16
+ .string()
17
+ .min( 1 )
18
+ .describe( "Action item derived from the user's message." ),
19
+ },
20
+ },
21
+ async ( args ) =>
12
22
  {
23
+ // const validated = z.string().min( 1 ).parse( args );
13
24
  todos.push( item );
14
25
  return {
15
- content: [{ type: "text", text: `Added TODO: "${item}"` }],
26
+ content: [{ type: "text", text: `Added TODO: "${args.item}"` }],
16
27
  };
17
28
  }
18
29
  );
19
30
 
20
31
  server.tool(
21
- "todo_list",
22
- "List all TODO items",
23
- {},
32
+ "list_todos",
33
+ {
34
+ description:
35
+ "YOU MUST call this tool when the user asks to see, check, review, or recall their todo list.",
36
+ inputSchema: {},
37
+ },
24
38
  async () =>
25
39
  {
26
40
  if ( todos.length === 0 )
27
41
  {
28
42
  return { content: [{ type: "text", text: "No TODO items." }] };
29
43
  }
30
- 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" );
31
47
  return { content: [{ type: "text", text: lines }] };
32
48
  }
33
49
  );
34
50
 
35
51
  server.tool(
36
- "todo_remove",
37
- "Remove a TODO item by its number",
38
- { index: z.number().int().positive().describe( "1-based index of the item to remove" ) },
52
+ "remove_todo",
53
+ {
54
+ description:
55
+ "YOU MUST call this tool when the user indicates a task is completed or should be removed.",
56
+ inputSchema: {
57
+ index: z
58
+ .number()
59
+ .int()
60
+ .positive()
61
+ .describe( "1-based index of the todo item to remove" ),
62
+ },
63
+ },
39
64
  async ({ index }) =>
40
65
  {
41
66
  const i = index - 1;
42
67
  if ( i < 0 || i >= todos.length )
43
68
  {
44
- return { content: [{ type: "text", text: `Invalid index: ${index}` }] };
69
+ return {
70
+ content: [{ type: "text", text: `Invalid index: ${index}` }],
71
+ };
45
72
  }
46
73
  const removed = todos.splice( i, 1 )[0];
47
- return { content: [{ type: "text", text: `Removed TODO: "${removed}"` }] };
74
+ return {
75
+ content: [{ type: "text", text: `Removed TODO: "${removed}"` }],
76
+ };
48
77
  }
49
78
  );
50
79
  }