togello-mcp-server 1.0.5 → 1.0.8

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.
package/README.md CHANGED
@@ -31,6 +31,10 @@ This server implements the Model Context Protocol (MCP) for managing context in
31
31
  - create-task: TODO機能で新しいタスクを作成します。タスク名を指定する必要があります。
32
32
  - get-todo-category-list: TODO機能からカテゴリーリストを取得します。カテゴリー名 / カテゴリーUUID を認識できます。
33
33
  - get-today-calendar: 連携しているGoogleカレンダーの昨日/今日/明日の予定を取得します。予定名 / 開始日時 / 終了日時 を認識できます。
34
+ - get-activity-item-list: 統合機能からアクティビティ項目のリストを取得します。アクティビティ項目UUID / 項目名 を認識できます。
35
+ - get-activity-log-list: 統合機能からアクティビティログのリストを取得します。すべてのログの終了日時が入力されている場合、現在何も実行していないことを意味します。終了日時がnullのものがある場合(最大で1つ)、現在その活動を実行中であることを意味します。アクティビティログUUID / 開始日時 / 終了日時 / 項目名 を認識できます。
36
+ - start-activity-log: アクティビティログを開始します。get-activity-log-listのすべてのendDateTimeに値がある場合、何も実行されていないため、start-activity-logを呼び出すことができます。
37
+ - complete-activity-log: アクティビティログを完了します。get-activity-log-listのendDateTimeにnullがある場合(つまり開始されているアクティビティがある場合)に使用できます。
34
38
 
35
39
  ```
36
40
 
package/build/client.js CHANGED
@@ -37,4 +37,23 @@ export const httpClient = {
37
37
  }
38
38
  return (await response.json());
39
39
  },
40
+ putJson: async ({ path, body }) => {
41
+ const token = process.env.TOGELLO_API_TOKEN;
42
+ if (!token) {
43
+ throw new Error("environment variable TOGELLO_API_TOKEN is not set");
44
+ }
45
+ const url = `${API_BASE_URL}${path}`;
46
+ const response = await fetch(url, {
47
+ method: "PUT",
48
+ headers: {
49
+ Authorization: `Bearer ${token}`,
50
+ "Content-Type": "application/json",
51
+ },
52
+ body: JSON.stringify(body),
53
+ });
54
+ if (!response.ok) {
55
+ throw new Error(`response status: ${response.status}`);
56
+ }
57
+ return (await response.json());
58
+ },
40
59
  };
@@ -0,0 +1,28 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const completeActivityLogHandler = async ({ activityLogUUID }) => {
3
+ try {
4
+ await httpClient.putJson({
5
+ path: `/v2/integration/activity-logs/${activityLogUUID}/work-complete`,
6
+ body: {},
7
+ });
8
+ return {
9
+ content: [
10
+ {
11
+ type: "text",
12
+ text: `Activity log with UUID "${activityLogUUID}" completed successfully.`,
13
+ },
14
+ ],
15
+ };
16
+ }
17
+ catch (error) {
18
+ console.error("Error completing activity log:", error);
19
+ return {
20
+ content: [
21
+ {
22
+ type: "text",
23
+ text: `Error completing activity log: ${error}`,
24
+ },
25
+ ],
26
+ };
27
+ }
28
+ };
@@ -1,10 +1,11 @@
1
1
  import { httpClient } from "../../client.js";
2
- export const createTaskHandler = async ({ taskName, }) => {
2
+ export const createTaskHandler = async ({ taskName, categoryUUID, }) => {
3
3
  try {
4
4
  await httpClient.postJson({
5
5
  path: "/v2/integration/todo",
6
6
  body: {
7
7
  label: taskName,
8
+ categoryUUID: categoryUUID,
8
9
  },
9
10
  });
10
11
  return {
@@ -0,0 +1,34 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const getActivityItemListHandler = async ({}) => {
3
+ try {
4
+ const activityItemList = await httpClient.fetchURL({
5
+ path: "/v2/integration/activity-items",
6
+ });
7
+ return {
8
+ content: [
9
+ {
10
+ type: "text",
11
+ text: `The following is a single activity item represented in the order:
12
+ [activity item uuid, item name]`,
13
+ },
14
+ {
15
+ type: "text",
16
+ text: activityItemList
17
+ .map((item) => [item.activityItemUUID, item.itemName])
18
+ .join(","),
19
+ },
20
+ ],
21
+ };
22
+ }
23
+ catch (error) {
24
+ console.error("Error in tool handler:", error);
25
+ return {
26
+ content: [
27
+ {
28
+ type: "text",
29
+ text: `Error in tool handler: ${error}`,
30
+ },
31
+ ],
32
+ };
33
+ }
34
+ };
@@ -0,0 +1,38 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const getActivityLogListHandler = async ({}) => {
3
+ try {
4
+ const activityLogList = await httpClient.fetchURL({
5
+ path: "/v2/integration/activity-logs",
6
+ });
7
+ return {
8
+ content: [
9
+ {
10
+ type: "text",
11
+ text: `The following is a list of activity logs. Since it is a record of what the person has done, if all the end dates are filled in, this person is not doing anything now. If there is one with a null end date, there should be at most one, and if there is one, it means that the person is doing it now. The information is in the following order: [activity log UUID, start date and time, end date and time, item name]`,
12
+ },
13
+ {
14
+ type: "text",
15
+ text: activityLogList
16
+ .map((log) => [
17
+ log.activityLogUUID,
18
+ log.startDateTime,
19
+ log.endDateTime,
20
+ log.itemName,
21
+ ])
22
+ .join("\n"),
23
+ },
24
+ ],
25
+ };
26
+ }
27
+ catch (error) {
28
+ console.error("Error in activity log list handler:", error);
29
+ return {
30
+ content: [
31
+ {
32
+ type: "text",
33
+ text: `アクティビティログの取得中にエラーが発生しました: ${error}`,
34
+ },
35
+ ],
36
+ };
37
+ }
38
+ };
@@ -0,0 +1,30 @@
1
+ import { httpClient } from "../../client.js";
2
+ export const startActivityLogHandler = async ({ activityItemName }) => {
3
+ try {
4
+ await httpClient.postJson({
5
+ path: "/v2/integration/activity-logs",
6
+ body: {
7
+ activityItemName: activityItemName,
8
+ },
9
+ });
10
+ return {
11
+ content: [
12
+ {
13
+ type: "text",
14
+ text: `Activity log for "${activityItemName}" started successfully.`,
15
+ },
16
+ ],
17
+ };
18
+ }
19
+ catch (error) {
20
+ console.error("Error starting activity log:", error);
21
+ return {
22
+ content: [
23
+ {
24
+ type: "text",
25
+ text: `Error starting activity log: ${error}`,
26
+ },
27
+ ],
28
+ };
29
+ }
30
+ };
package/build/index.js CHANGED
@@ -2,11 +2,14 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
- import { categoryListHandler } from "./handlers/resource/categoryListHandler.js";
5
+ import { completeActivityLogHandler } from "./handlers/tool/completeActivityLogHandler.js";
6
6
  import { createTaskHandler } from "./handlers/tool/createTaskHandler.js";
7
+ import { getActivityItemListHandler } from "./handlers/tool/getActivityItemListHandler.js";
8
+ import { getActivityLogListHandler } from "./handlers/tool/getActivityLogListHandler.js";
7
9
  import { getTodayCalendarHandler } from "./handlers/tool/getTodayCalendarHandler.js";
8
10
  import { getTodoCategoryListHandler } from "./handlers/tool/getTodoCategoryListHandler.js";
9
11
  import { getTodoListHandler } from "./handlers/tool/getTodoListHandler.js";
12
+ import { startActivityLogHandler } from "./handlers/tool/startActivityLogHandler.js";
10
13
  const server = new McpServer({
11
14
  name: "togello",
12
15
  version: "1.0.0",
@@ -23,7 +26,11 @@ async function main() {
23
26
  // "togello://category-list",
24
27
  // categoryListHandler
25
28
  // );
26
- server.resource("activity-item-list", "togello://activity-item-list", categoryListHandler);
29
+ // server.resource(
30
+ // "activity-item-list",
31
+ // "togello://activity-item-list",
32
+ // categoryListHandler
33
+ // );
27
34
  server.tool("get-tasks-list", "Retrieves incomplete tasks from the TODO feature. Recognizes task name / scheduled start date and time / scheduled end date and time / priority / category", {}, getTodoListHandler);
28
35
  server.tool("create-task", "Creates a new task in the TODO feature.", {
29
36
  taskName: z.string().describe("create task name"),
@@ -34,6 +41,18 @@ async function main() {
34
41
  }, createTaskHandler);
35
42
  server.tool("get-todo-category-list", "Retrieves the list of categories from the TODO feature. Recognizes category name / category UUID", {}, getTodoCategoryListHandler);
36
43
  server.tool("get-today-calendar", "Retrieves scheduled events for yesterday/today/tomorrow from the linked Google Calendar. Recognizes event name / start date and time / end date and time. ", {}, getTodayCalendarHandler);
44
+ server.tool("get-activity-item-list", "Retrieves the list of activity items from the integration feature. Recognizes activity item UUID / item name", {}, getActivityItemListHandler);
45
+ server.tool("get-activity-log-list", "Retrieves the list of activity logs from the integration feature. Since it is a record of what the person has done, if all the end dates are filled in, this person is not doing anything now. If there is one with a null end date, there should be at most one, and if there is one, it means that the person is doing it now. Recognizes activity log UUID / start date and time / end date and time / item name.", {}, getActivityLogListHandler);
46
+ server.tool("start-activity-log", "Starts an activity log. If all the endDateTime of get-activity-log-list have values, it means that nothing is being done, so start-activity-log can be called.", {
47
+ activityItemName: z
48
+ .string()
49
+ .describe("Activity log name. Please specify the itemName obtained from get-activity-item-list. You cannot specify a value that is not in itemName, so this tool cannot be used."),
50
+ }, startActivityLogHandler);
51
+ server.tool("complete-activity-log", "Completes an activity log. If all the endDateTime of get-activity-log-list have values, it means that nothing is being done, so start-activity-log can be called.", {
52
+ activityLogUUID: z
53
+ .string()
54
+ .describe("Activity log UUID. Please specify the activityLogUUID obtained from get-activity-log-list. You cannot specify a value that is not in activityLogUUID, so this tool cannot be used."),
55
+ }, completeActivityLogHandler);
37
56
  await server.connect(transport);
38
57
  }
39
58
  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.5",
4
+ "version": "1.0.8",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "build": "tsc && chmod 755 build/index.js",