togello-mcp-server 1.0.1 → 1.0.3

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.
@@ -0,0 +1,38 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const getTodayCalendarHandler = async ({}) => {
3
+ try {
4
+ const googleEvents = await httpClient.fetchURL({
5
+ path: "/v2/integration/google-calendar/event",
6
+ });
7
+ return {
8
+ content: [
9
+ {
10
+ type: "text",
11
+ text: `The following is a single event represented in the order:
12
+ [title of event, start date of event, end date of event]`,
13
+ },
14
+ {
15
+ type: "text",
16
+ text: googleEvents.items
17
+ .map((event) => [
18
+ event.summary,
19
+ event.start.dateTime,
20
+ event.end.dateTime,
21
+ ])
22
+ .join(","),
23
+ },
24
+ ],
25
+ };
26
+ }
27
+ catch (error) {
28
+ console.error("Error in tool handler:", error);
29
+ return {
30
+ content: [
31
+ {
32
+ type: "text",
33
+ text: `Error in tool handler: ${error}`,
34
+ },
35
+ ],
36
+ };
37
+ }
38
+ };
@@ -8,15 +8,34 @@ export const getTodoListHandler = async ({}) => {
8
8
  content: [
9
9
  {
10
10
  type: "text",
11
- uri: new URL("togello://tasks"),
11
+ text: `The following is a single task represented in the order:
12
+ [label of the task, scheduled start date, scheduled end date, priority, category of the task]`,
13
+ },
14
+ {
15
+ type: "text",
16
+ text: `The tasks with scheduled start dates that are today or in the past, and those with a priority of 2, should be addressed as soon as possible.`,
17
+ },
18
+ {
19
+ type: "text",
12
20
  text: tasks
13
- .map((todo) => JSON.stringify({
14
- label: todo.label,
15
- scheduledStartDate: todo.scheduledStartDate,
16
- scheduledEndDate: todo.scheduledEndDate,
17
- priorityNumber: todo.priorityNumber,
18
- }))
21
+ .map((todo) => [
22
+ todo.label,
23
+ todo.scheduledStartDate,
24
+ todo.scheduledEndDate,
25
+ todo.priorityNumber,
26
+ todo.categoryLabel,
27
+ ])
19
28
  .join(","),
29
+ // text: tasks
30
+ // .map((todo) =>
31
+ // JSON.stringify({
32
+ // label: todo.label,
33
+ // scheduledStartDate: todo.scheduledStartDate,
34
+ // scheduledEndDate: todo.scheduledEndDate,
35
+ // priorityNumber: todo.priorityNumber,
36
+ // })
37
+ // )
38
+ // .join(","),
20
39
  },
21
40
  ],
22
41
  };
@@ -27,7 +46,6 @@ export const getTodoListHandler = async ({}) => {
27
46
  content: [
28
47
  {
29
48
  type: "text",
30
- uri: new URL("togello://tasks"),
31
49
  text: `Error in tool handler: ${error}`,
32
50
  },
33
51
  ],
package/build/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { getTodayCalendarHandler } from "./handlers/tool/getTodayCalendarHandler.js";
4
5
  import { getTodoListHandler } from "./handlers/tool/getTodoListHandler.js";
5
6
  const server = new McpServer({
6
7
  name: "togello",
@@ -14,6 +15,7 @@ async function main() {
14
15
  const transport = new StdioServerTransport();
15
16
  // server.resource("togello-todos", "togello://tasks", tasksHandler);
16
17
  server.tool("get-tasks-list", {}, getTodoListHandler);
18
+ server.tool("get-today-calendar", {}, getTodayCalendarHandler);
17
19
  await server.connect(transport);
18
20
  }
19
21
  main().catch((error) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "togello-mcp-server",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "build": "tsc && chmod 755 build/index.js",