togello-mcp-server 1.0.10 → 1.0.12
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 +1 -1
- package/build/client.js +10 -10
- package/build/handlers/resource/activityItemListHandler.js +8 -8
- package/build/handlers/resource/categoryListHandler.js +8 -8
- package/build/handlers/resource/tasksHandler.js +7 -7
- package/build/handlers/tool/completeActivityLogHandler.js +4 -4
- package/build/handlers/tool/createTaskHandler.js +8 -6
- package/build/handlers/tool/getActivityItemListHandler.js +8 -8
- package/build/handlers/tool/getActivityLogListHandler.js +9 -9
- package/build/handlers/tool/getTodayCalendarHandler.js +9 -13
- package/build/handlers/tool/getTodoCategoryListHandler.js +8 -8
- package/build/handlers/tool/getTodoListHandler.js +10 -10
- package/build/handlers/tool/startActivityLogHandler.js +5 -5
- package/build/handlers/tool/updateTaskHandler.js +5 -5
- package/build/index.js +38 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ This server implements the Model Context Protocol (MCP) for managing context in
|
|
|
28
28
|
## Tools
|
|
29
29
|
|
|
30
30
|
- get-tasks-list: TODO機能で未完了のタスクを取得します。タスクUUID / タスク名 / 予定開始日時 / 予定終了日時 / 優先度 / カテゴリ を認識できます。
|
|
31
|
-
- create-task: TODO
|
|
31
|
+
- create-task: TODO機能で新しいタスクを作成します。タスク名(taskName)を指定する必要があります。カテゴリーUUID(categoryUUID)、予定開始日時(scheduledStartDate)、URL(url)もオプションで指定できます。
|
|
32
32
|
- update-task: TODO機能でタスクを更新します。タスクの完了状態を更新できます。get-tasks-listで取得したタスクUUIDを指定する必要があります。
|
|
33
33
|
- get-todo-category-list: TODO機能からカテゴリーリストを取得します。カテゴリー名 / カテゴリーUUID を認識できます。
|
|
34
34
|
- get-today-calendar: 連携しているGoogleカレンダーの昨日/今日/明日の予定を取得します。予定名 / 開始日時 / 終了日時 を認識できます。
|
package/build/client.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const API_BASE_URL =
|
|
1
|
+
const API_BASE_URL = 'https://togello.api.toru-takagi.dev';
|
|
2
2
|
export const httpClient = {
|
|
3
3
|
fetchURL: async ({ path }) => {
|
|
4
4
|
const token = process.env.TOGELLO_API_TOKEN;
|
|
5
5
|
if (!token) {
|
|
6
|
-
throw new Error(
|
|
6
|
+
throw new Error('environment variable TOGELLO_API_TOKEN is not set');
|
|
7
7
|
}
|
|
8
8
|
const url = `${API_BASE_URL}${path}`;
|
|
9
9
|
const response = await fetch(url, {
|
|
10
|
-
method:
|
|
10
|
+
method: 'GET',
|
|
11
11
|
headers: {
|
|
12
12
|
Authorization: `Bearer ${token}`,
|
|
13
|
-
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
if (!response.ok) {
|
|
@@ -21,14 +21,14 @@ export const httpClient = {
|
|
|
21
21
|
postJson: async ({ path, body }) => {
|
|
22
22
|
const token = process.env.TOGELLO_API_TOKEN;
|
|
23
23
|
if (!token) {
|
|
24
|
-
throw new Error(
|
|
24
|
+
throw new Error('environment variable TOGELLO_API_TOKEN is not set');
|
|
25
25
|
}
|
|
26
26
|
const url = `${API_BASE_URL}${path}`;
|
|
27
27
|
const response = await fetch(url, {
|
|
28
|
-
method:
|
|
28
|
+
method: 'POST',
|
|
29
29
|
headers: {
|
|
30
30
|
Authorization: `Bearer ${token}`,
|
|
31
|
-
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
32
|
},
|
|
33
33
|
body: JSON.stringify(body),
|
|
34
34
|
});
|
|
@@ -40,15 +40,15 @@ export const httpClient = {
|
|
|
40
40
|
putJson: async ({ path, body }) => {
|
|
41
41
|
const token = process.env.TOGELLO_API_TOKEN;
|
|
42
42
|
if (!token) {
|
|
43
|
-
throw new Error(
|
|
43
|
+
throw new Error('environment variable TOGELLO_API_TOKEN is not set');
|
|
44
44
|
}
|
|
45
45
|
const url = `${API_BASE_URL}${path}`;
|
|
46
46
|
const bodyString = body !== null ? JSON.stringify(body) : null;
|
|
47
47
|
const response = await fetch(url, {
|
|
48
|
-
method:
|
|
48
|
+
method: 'PUT',
|
|
49
49
|
headers: {
|
|
50
50
|
Authorization: `Bearer ${token}`,
|
|
51
|
-
|
|
51
|
+
'Content-Type': 'application/json',
|
|
52
52
|
},
|
|
53
53
|
body: bodyString,
|
|
54
54
|
});
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const activityItemListHandler = async (uri,
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const activityItemListHandler = async (uri, _options) => {
|
|
3
3
|
try {
|
|
4
4
|
const activityItemList = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/activity-items',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
contents: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
uri: uri.href,
|
|
12
12
|
text: `The following is a single activity item represented in the order:
|
|
13
13
|
[activity item uuid, item name]`,
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
type:
|
|
16
|
+
type: 'text',
|
|
17
17
|
uri: uri.href,
|
|
18
18
|
text: activityItemList
|
|
19
19
|
.map((item) => [item.activityItemUUID, item.itemName])
|
|
20
|
-
.join(
|
|
20
|
+
.join(','),
|
|
21
21
|
},
|
|
22
22
|
],
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
26
|
-
console.error(
|
|
26
|
+
console.error('Error in resource handler:', error);
|
|
27
27
|
return {
|
|
28
28
|
contents: [
|
|
29
29
|
{
|
|
30
|
-
type:
|
|
30
|
+
type: 'text',
|
|
31
31
|
uri: uri.href,
|
|
32
32
|
text: `Error in resource handler: ${error}`,
|
|
33
33
|
},
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const categoryListHandler = async (uri,
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const categoryListHandler = async (uri, _options) => {
|
|
3
3
|
try {
|
|
4
4
|
const categoryList = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/categories',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
contents: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
uri: uri.href,
|
|
12
12
|
text: `The following is a single category represented in the order:
|
|
13
13
|
[category uuid, label of category]`,
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
type:
|
|
16
|
+
type: 'text',
|
|
17
17
|
uri: uri.href,
|
|
18
18
|
text: categoryList
|
|
19
19
|
.map((category) => [category.categoryUUID, category.label])
|
|
20
|
-
.join(
|
|
20
|
+
.join(','),
|
|
21
21
|
},
|
|
22
22
|
],
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
26
|
-
console.error(
|
|
26
|
+
console.error('Error in resource handler:', error);
|
|
27
27
|
return {
|
|
28
28
|
contents: [
|
|
29
29
|
{
|
|
30
|
-
type:
|
|
30
|
+
type: 'text',
|
|
31
31
|
uri: uri.href,
|
|
32
32
|
text: `Error in resource handler: ${error}`,
|
|
33
33
|
},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const tasksHandler = async (uri,
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const tasksHandler = async (uri, _options) => {
|
|
3
3
|
try {
|
|
4
4
|
const tasks = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/todo',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
contents: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
uri: uri.href,
|
|
12
12
|
text: tasks
|
|
13
13
|
.map((todo) => JSON.stringify({
|
|
@@ -16,17 +16,17 @@ export const tasksHandler = async (uri, {}) => {
|
|
|
16
16
|
scheduledEndDate: todo.scheduledEndDate,
|
|
17
17
|
priorityNumber: todo.priorityNumber,
|
|
18
18
|
}))
|
|
19
|
-
.join(
|
|
19
|
+
.join(','),
|
|
20
20
|
},
|
|
21
21
|
],
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
catch (error) {
|
|
25
|
-
console.error(
|
|
25
|
+
console.error('Error in resource handler:', error);
|
|
26
26
|
return {
|
|
27
27
|
contents: [
|
|
28
28
|
{
|
|
29
|
-
type:
|
|
29
|
+
type: 'text',
|
|
30
30
|
uri: uri.href,
|
|
31
31
|
text: `Error in resource handler: ${error}`,
|
|
32
32
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { httpClient } from
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
2
|
export const completeActivityLogHandler = async ({ activityLogUUID }) => {
|
|
3
3
|
try {
|
|
4
4
|
await httpClient.putJson({
|
|
@@ -8,18 +8,18 @@ export const completeActivityLogHandler = async ({ activityLogUUID }) => {
|
|
|
8
8
|
return {
|
|
9
9
|
content: [
|
|
10
10
|
{
|
|
11
|
-
type:
|
|
11
|
+
type: 'text',
|
|
12
12
|
text: `Activity log with UUID "${activityLogUUID}" completed successfully.`,
|
|
13
13
|
},
|
|
14
14
|
],
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
|
-
console.error(
|
|
18
|
+
console.error('Error completing activity log:', error);
|
|
19
19
|
return {
|
|
20
20
|
content: [
|
|
21
21
|
{
|
|
22
|
-
type:
|
|
22
|
+
type: 'text',
|
|
23
23
|
text: `Error completing activity log: ${error}`,
|
|
24
24
|
},
|
|
25
25
|
],
|
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const createTaskHandler = async ({ taskName, categoryUUID, }) => {
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const createTaskHandler = async ({ taskName, categoryUUID, scheduledStartDate, url, }) => {
|
|
3
3
|
try {
|
|
4
4
|
await httpClient.postJson({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/todo',
|
|
6
6
|
body: {
|
|
7
7
|
label: taskName,
|
|
8
8
|
categoryUUID: categoryUUID,
|
|
9
|
+
scheduledStartDate: scheduledStartDate,
|
|
10
|
+
url: url,
|
|
9
11
|
},
|
|
10
12
|
});
|
|
11
13
|
return {
|
|
12
14
|
content: [
|
|
13
15
|
{
|
|
14
|
-
type:
|
|
16
|
+
type: 'text',
|
|
15
17
|
text: `Task "${taskName}" created successfully.`,
|
|
16
18
|
},
|
|
17
19
|
],
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
22
|
catch (error) {
|
|
21
|
-
console.error(
|
|
23
|
+
console.error('Error creating task:', error);
|
|
22
24
|
return {
|
|
23
25
|
content: [
|
|
24
26
|
{
|
|
25
|
-
type:
|
|
27
|
+
type: 'text',
|
|
26
28
|
text: `Error creating task: ${error}`,
|
|
27
29
|
},
|
|
28
30
|
],
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const getActivityItemListHandler = async (
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const getActivityItemListHandler = async () => {
|
|
3
3
|
try {
|
|
4
4
|
const activityItemList = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/activity-items',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
content: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
text: `The following is a single activity item represented in the order:
|
|
12
12
|
[activity item uuid, item name]`,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
type:
|
|
15
|
+
type: 'text',
|
|
16
16
|
text: activityItemList
|
|
17
17
|
.map((item) => [item.activityItemUUID, item.itemName])
|
|
18
|
-
.join(
|
|
18
|
+
.join(','),
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
|
-
console.error(
|
|
24
|
+
console.error('Error in tool handler:', error);
|
|
25
25
|
return {
|
|
26
26
|
content: [
|
|
27
27
|
{
|
|
28
|
-
type:
|
|
28
|
+
type: 'text',
|
|
29
29
|
text: `Error in tool handler: ${error}`,
|
|
30
30
|
},
|
|
31
31
|
],
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const getActivityLogListHandler = async (
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const getActivityLogListHandler = async () => {
|
|
3
3
|
try {
|
|
4
4
|
const activityLogList = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/activity-logs',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
content: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
11
|
-
text:
|
|
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
12
|
},
|
|
13
13
|
{
|
|
14
|
-
type:
|
|
14
|
+
type: 'text',
|
|
15
15
|
text: activityLogList
|
|
16
16
|
.map((log) => [
|
|
17
17
|
log.activityLogUUID,
|
|
@@ -19,17 +19,17 @@ export const getActivityLogListHandler = async ({}) => {
|
|
|
19
19
|
log.endDateTime,
|
|
20
20
|
log.itemName,
|
|
21
21
|
])
|
|
22
|
-
.join(
|
|
22
|
+
.join('\n'),
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
catch (error) {
|
|
28
|
-
console.error(
|
|
28
|
+
console.error('Error in activity log list handler:', error);
|
|
29
29
|
return {
|
|
30
30
|
content: [
|
|
31
31
|
{
|
|
32
|
-
type:
|
|
32
|
+
type: 'text',
|
|
33
33
|
text: `アクティビティログの取得中にエラーが発生しました: ${error}`,
|
|
34
34
|
},
|
|
35
35
|
],
|
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const getTodayCalendarHandler = async (
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const getTodayCalendarHandler = async () => {
|
|
3
3
|
try {
|
|
4
4
|
const googleEvents = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/google-calendar/event',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
content: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
text: `The following is a single event represented in the order:
|
|
12
12
|
[title of event, start date of event, end date of event]`,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
type:
|
|
15
|
+
type: 'text',
|
|
16
16
|
text: googleEvents.items
|
|
17
|
-
.map((event) => [
|
|
18
|
-
|
|
19
|
-
event.start.dateTime,
|
|
20
|
-
event.end.dateTime,
|
|
21
|
-
])
|
|
22
|
-
.join(","),
|
|
17
|
+
.map((event) => [event.summary, event.start, event.end])
|
|
18
|
+
.join(','),
|
|
23
19
|
},
|
|
24
20
|
],
|
|
25
21
|
};
|
|
26
22
|
}
|
|
27
23
|
catch (error) {
|
|
28
|
-
console.error(
|
|
24
|
+
console.error('Error in tool handler:', error);
|
|
29
25
|
return {
|
|
30
26
|
content: [
|
|
31
27
|
{
|
|
32
|
-
type:
|
|
28
|
+
type: 'text',
|
|
33
29
|
text: `Error in tool handler: ${error}`,
|
|
34
30
|
},
|
|
35
31
|
],
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const getTodoCategoryListHandler = async (
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const getTodoCategoryListHandler = async () => {
|
|
3
3
|
try {
|
|
4
4
|
const categoryList = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/categories',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
content: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
text: `The following is a single category represented in the order:
|
|
12
12
|
[category uuid, label of category]`,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
type:
|
|
15
|
+
type: 'text',
|
|
16
16
|
text: categoryList
|
|
17
17
|
.map((category) => [category.categoryUUID, category.label])
|
|
18
|
-
.join(
|
|
18
|
+
.join(','),
|
|
19
19
|
},
|
|
20
20
|
],
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
|
-
console.error(
|
|
24
|
+
console.error('Error in tool handler:', error);
|
|
25
25
|
return {
|
|
26
26
|
content: [
|
|
27
27
|
{
|
|
28
|
-
type:
|
|
28
|
+
type: 'text',
|
|
29
29
|
text: `Error in tool handler: ${error}`,
|
|
30
30
|
},
|
|
31
31
|
],
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { httpClient } from
|
|
2
|
-
export const getTodoListHandler = async (
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
|
+
export const getTodoListHandler = async () => {
|
|
3
3
|
try {
|
|
4
4
|
const tasks = await httpClient.fetchURL({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/todo',
|
|
6
6
|
});
|
|
7
7
|
return {
|
|
8
8
|
content: [
|
|
9
9
|
{
|
|
10
|
-
type:
|
|
10
|
+
type: 'text',
|
|
11
11
|
text: `The following is a single task represented in the order:
|
|
12
12
|
[todo uuid, label of the task, scheduled start date, scheduled end date, priority, category of the task]`,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
type:
|
|
16
|
-
text:
|
|
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
17
|
},
|
|
18
18
|
{
|
|
19
|
-
type:
|
|
19
|
+
type: 'text',
|
|
20
20
|
text: tasks
|
|
21
21
|
.map((todo) => [
|
|
22
22
|
todo.todoUUID,
|
|
@@ -26,17 +26,17 @@ export const getTodoListHandler = async ({}) => {
|
|
|
26
26
|
todo.priorityNumber,
|
|
27
27
|
todo.categoryLabel,
|
|
28
28
|
])
|
|
29
|
-
.join(
|
|
29
|
+
.join(','),
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
|
-
console.error(
|
|
35
|
+
console.error('Error in tool handler:', error);
|
|
36
36
|
return {
|
|
37
37
|
content: [
|
|
38
38
|
{
|
|
39
|
-
type:
|
|
39
|
+
type: 'text',
|
|
40
40
|
text: `Error in tool handler: ${error}`,
|
|
41
41
|
},
|
|
42
42
|
],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { httpClient } from
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
2
|
export const startActivityLogHandler = async ({ activityItemName }) => {
|
|
3
3
|
try {
|
|
4
4
|
await httpClient.postJson({
|
|
5
|
-
path:
|
|
5
|
+
path: '/v2/integration/activity-logs',
|
|
6
6
|
body: {
|
|
7
7
|
activityItemName: activityItemName,
|
|
8
8
|
},
|
|
@@ -10,18 +10,18 @@ export const startActivityLogHandler = async ({ activityItemName }) => {
|
|
|
10
10
|
return {
|
|
11
11
|
content: [
|
|
12
12
|
{
|
|
13
|
-
type:
|
|
13
|
+
type: 'text',
|
|
14
14
|
text: `Activity log for "${activityItemName}" started successfully.`,
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
|
-
console.error(
|
|
20
|
+
console.error('Error starting activity log:', error);
|
|
21
21
|
return {
|
|
22
22
|
content: [
|
|
23
23
|
{
|
|
24
|
-
type:
|
|
24
|
+
type: 'text',
|
|
25
25
|
text: `Error starting activity log: ${error}`,
|
|
26
26
|
},
|
|
27
27
|
],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { httpClient } from
|
|
1
|
+
import { httpClient } from '../../client.js';
|
|
2
2
|
export const updateTaskHandler = async ({ todoUUID, isCompleted, }) => {
|
|
3
3
|
try {
|
|
4
4
|
await httpClient.putJson({
|
|
@@ -10,18 +10,18 @@ export const updateTaskHandler = async ({ todoUUID, isCompleted, }) => {
|
|
|
10
10
|
return {
|
|
11
11
|
content: [
|
|
12
12
|
{
|
|
13
|
-
type:
|
|
14
|
-
text: `Task status updated successfully. Task is now ${isCompleted ?
|
|
13
|
+
type: 'text',
|
|
14
|
+
text: `Task status updated successfully. Task is now ${isCompleted ? 'completed' : 'incomplete'}.`,
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
catch (error) {
|
|
20
|
-
console.error(
|
|
20
|
+
console.error('Error updating task:', error);
|
|
21
21
|
return {
|
|
22
22
|
content: [
|
|
23
23
|
{
|
|
24
|
-
type:
|
|
24
|
+
type: 'text',
|
|
25
25
|
text: `Error updating task: ${error}`,
|
|
26
26
|
},
|
|
27
27
|
],
|
package/build/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from
|
|
3
|
-
import { StdioServerTransport } from
|
|
4
|
-
import { z } from
|
|
5
|
-
import { completeActivityLogHandler } from
|
|
6
|
-
import { createTaskHandler } from
|
|
7
|
-
import { getActivityItemListHandler } from
|
|
8
|
-
import { getActivityLogListHandler } from
|
|
9
|
-
import { getTodayCalendarHandler } from
|
|
10
|
-
import { getTodoCategoryListHandler } from
|
|
11
|
-
import { getTodoListHandler } from
|
|
12
|
-
import { startActivityLogHandler } from
|
|
13
|
-
import { updateTaskHandler } from
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { completeActivityLogHandler } from './handlers/tool/completeActivityLogHandler.js';
|
|
6
|
+
import { createTaskHandler } from './handlers/tool/createTaskHandler.js';
|
|
7
|
+
import { getActivityItemListHandler } from './handlers/tool/getActivityItemListHandler.js';
|
|
8
|
+
import { getActivityLogListHandler } from './handlers/tool/getActivityLogListHandler.js';
|
|
9
|
+
import { getTodayCalendarHandler } from './handlers/tool/getTodayCalendarHandler.js';
|
|
10
|
+
import { getTodoCategoryListHandler } from './handlers/tool/getTodoCategoryListHandler.js';
|
|
11
|
+
import { getTodoListHandler } from './handlers/tool/getTodoListHandler.js';
|
|
12
|
+
import { startActivityLogHandler } from './handlers/tool/startActivityLogHandler.js';
|
|
13
|
+
import { updateTaskHandler } from './handlers/tool/updateTaskHandler.js';
|
|
14
14
|
const server = new McpServer({
|
|
15
|
-
name:
|
|
16
|
-
version:
|
|
15
|
+
name: 'togello',
|
|
16
|
+
version: '1.0.0',
|
|
17
17
|
capabilities: {
|
|
18
18
|
resources: {},
|
|
19
19
|
tools: {},
|
|
@@ -32,39 +32,47 @@ async function main() {
|
|
|
32
32
|
// "togello://activity-item-list",
|
|
33
33
|
// categoryListHandler
|
|
34
34
|
// );
|
|
35
|
-
server.tool(
|
|
36
|
-
server.tool(
|
|
37
|
-
taskName: z.string().describe(
|
|
35
|
+
server.tool('get-tasks-list', 'Retrieves incomplete tasks from the TODO feature. Recognizes task uuid / task name / scheduled start date and time / scheduled end date and time / priority / category', {}, getTodoListHandler);
|
|
36
|
+
server.tool('create-task', 'Creates a new task in the TODO feature.', {
|
|
37
|
+
taskName: z.string().describe('create task name'),
|
|
38
38
|
categoryUUID: z
|
|
39
39
|
.string()
|
|
40
40
|
.optional()
|
|
41
|
-
.describe(
|
|
41
|
+
.describe('category UUID. category UUID of get-todo-category-list'),
|
|
42
|
+
scheduledStartDate: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Scheduled start date in ISO format.'),
|
|
46
|
+
url: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Optional URL associated with the task.'),
|
|
42
50
|
}, createTaskHandler);
|
|
43
|
-
server.tool(
|
|
51
|
+
server.tool('update-task', 'Updates a task in the TODO feature.', {
|
|
44
52
|
todoUUID: z
|
|
45
53
|
.string()
|
|
46
|
-
.describe(
|
|
54
|
+
.describe('Task UUID. Please specify the task uuid (todo uuid) obtained from get-tasks-list. You cannot use this tool without specifying it.'),
|
|
47
55
|
isCompleted: z
|
|
48
56
|
.boolean()
|
|
49
|
-
.describe(
|
|
57
|
+
.describe('You can update the completion status of the task. If true, it is completed. If false, it can be reverted to incomplete.'),
|
|
50
58
|
}, updateTaskHandler);
|
|
51
|
-
server.tool(
|
|
52
|
-
server.tool(
|
|
53
|
-
server.tool(
|
|
54
|
-
server.tool(
|
|
55
|
-
server.tool(
|
|
59
|
+
server.tool('get-todo-category-list', 'Retrieves the list of categories from the TODO feature. Recognizes category name / category UUID', {}, getTodoCategoryListHandler);
|
|
60
|
+
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);
|
|
61
|
+
server.tool('get-activity-item-list', 'Retrieves the list of activity items from the integration feature. Recognizes activity item UUID / item name', {}, getActivityItemListHandler);
|
|
62
|
+
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);
|
|
63
|
+
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.', {
|
|
56
64
|
activityItemName: z
|
|
57
65
|
.string()
|
|
58
|
-
.describe(
|
|
66
|
+
.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.'),
|
|
59
67
|
}, startActivityLogHandler);
|
|
60
|
-
server.tool(
|
|
68
|
+
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.', {
|
|
61
69
|
activityLogUUID: z
|
|
62
70
|
.string()
|
|
63
|
-
.describe(
|
|
71
|
+
.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.'),
|
|
64
72
|
}, completeActivityLogHandler);
|
|
65
73
|
await server.connect(transport);
|
|
66
74
|
}
|
|
67
75
|
main().catch((error) => {
|
|
68
|
-
console.error(
|
|
76
|
+
console.error('Fatal error in main():', error);
|
|
69
77
|
process.exit(1);
|
|
70
78
|
});
|