@glie/mcp-manager 0.0.0-stage → 0.1.0
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/LICENSE +201 -0
- package/README.md +44 -2
- package/dist/client.js +66 -0
- package/dist/index.js +39 -0
- package/dist/server.js +67 -0
- package/dist/tools.js +389 -0
- package/package.json +31 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work, excluding
|
|
103
|
+
those notices that do not pertain to any part of the Derivative
|
|
104
|
+
Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and do
|
|
117
|
+
not modify the License. You may add Your own attribution notices
|
|
118
|
+
within Derivative Works that You distribute, alongside or as an
|
|
119
|
+
addendum to the NOTICE text from the Work, provided that such
|
|
120
|
+
additional attribution notices cannot be construed as modifying
|
|
121
|
+
the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 glie
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @glie/mcp-manager
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An [MCP](https://modelcontextprotocol.io) server that lets Claude Code, Codex or any MCP client
|
|
4
|
+
work in [Manager](https://manager.glie.ai) — tasks, meetings, agendas, follow-ups, comments and
|
|
5
|
+
notifications — as you.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
1. In Manager, open **Account → Agents** and create a token. Choose the workspace and whether it
|
|
10
|
+
may write. Copy it: it is shown once.
|
|
11
|
+
2. Export it in the shell you start your agent from:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
export MANAGER_TOKEN='mgr_…'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
3. Register the server, for example in a project's `.mcp.json`:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"manager": {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "@glie/mcp-manager@latest"],
|
|
25
|
+
"env": { "MANAGER_URL": "https://manager.glie.ai", "MANAGER_TOKEN": "${MANAGER_TOKEN}" }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The token acts as you, in its workspace, with your role and visibility. Everything it does shows in
|
|
32
|
+
the task activity as "you · via <token name>". Revoke it any time from the same page.
|
|
33
|
+
|
|
34
|
+
## Tools
|
|
35
|
+
|
|
36
|
+
`manager_me`, `manager_attention`, `manager_people_list`, `manager_contact_create`,
|
|
37
|
+
`manager_tag_list`, `manager_team_list`, `manager_report_get`, `manager_task_list`,
|
|
38
|
+
`manager_task_get`, `manager_task_create`, `manager_task_update`, `manager_task_complete`,
|
|
39
|
+
`manager_task_cancel`, `manager_task_reopen`, `manager_task_reschedule`,
|
|
40
|
+
`manager_task_reschedule_history`, `manager_task_handshake`, `manager_meeting_rsvp`,
|
|
41
|
+
`manager_step_list|add|update|remove`, `manager_agenda_list|add|update|remove`,
|
|
42
|
+
`manager_followup_list|create|update|remove`, `manager_comment_list`, `manager_comment_add`,
|
|
43
|
+
`manager_activity_list`, `manager_notification_list`, `manager_notification_mark_read`.
|
|
44
|
+
|
|
45
|
+
The API behind them is described in the Manager repository, `docs/API.md`.
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin HTTP client for the Manager API (docs/API.md in the Manager repo).
|
|
3
|
+
* Every call carries the user's API token; the workspace is the one the token was made for.
|
|
4
|
+
*/
|
|
5
|
+
export class ManagerClient {
|
|
6
|
+
baseUrl;
|
|
7
|
+
token;
|
|
8
|
+
fetchImpl;
|
|
9
|
+
workspace = null;
|
|
10
|
+
constructor(baseUrl, token, fetchImpl = fetch) {
|
|
11
|
+
this.baseUrl = baseUrl;
|
|
12
|
+
this.token = token;
|
|
13
|
+
this.fetchImpl = fetchImpl;
|
|
14
|
+
}
|
|
15
|
+
async request(method, path, options = {}) {
|
|
16
|
+
const url = new URL(path, this.baseUrl);
|
|
17
|
+
for (const [key, value] of Object.entries(options.query ?? {})) {
|
|
18
|
+
if (value !== undefined)
|
|
19
|
+
url.searchParams.set(key, String(value));
|
|
20
|
+
}
|
|
21
|
+
const headers = {
|
|
22
|
+
Accept: "application/json",
|
|
23
|
+
Authorization: `Bearer ${this.token}`,
|
|
24
|
+
};
|
|
25
|
+
if (options.body !== undefined)
|
|
26
|
+
headers["Content-Type"] = "application/json";
|
|
27
|
+
if (options.idempotencyKey)
|
|
28
|
+
headers["Idempotency-Key"] = options.idempotencyKey;
|
|
29
|
+
const res = await this.fetchImpl(url, {
|
|
30
|
+
method,
|
|
31
|
+
headers,
|
|
32
|
+
body: options.body === undefined ? undefined : JSON.stringify(options.body),
|
|
33
|
+
});
|
|
34
|
+
const text = await res.text();
|
|
35
|
+
let body = text;
|
|
36
|
+
if (text) {
|
|
37
|
+
try {
|
|
38
|
+
body = JSON.parse(text);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Not JSON (a proxy error page, say): hand the raw text back.
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return { status: res.status, body };
|
|
45
|
+
}
|
|
46
|
+
/** `/api/workspaces/<id>` for the token's workspace, resolved once from `/api/me`. */
|
|
47
|
+
async workspacePath(rest = "") {
|
|
48
|
+
this.workspace ??= this.request("GET", "/api/me").then(({ status, body }) => {
|
|
49
|
+
const id = body?.data?.token
|
|
50
|
+
?.workspace?.id;
|
|
51
|
+
if (status !== 200 || !id) {
|
|
52
|
+
this.workspace = null;
|
|
53
|
+
throw new Error(`Could not resolve the token's workspace (${status}): ${describe(body)}`);
|
|
54
|
+
}
|
|
55
|
+
return id;
|
|
56
|
+
});
|
|
57
|
+
return `/api/workspaces/${await this.workspace}${rest}`;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function describe(body) {
|
|
61
|
+
if (body && typeof body === "object" && "error" in body) {
|
|
62
|
+
const { error, details } = body;
|
|
63
|
+
return details ? `${String(error)} ${JSON.stringify(details)}` : String(error);
|
|
64
|
+
}
|
|
65
|
+
return typeof body === "string" ? body.slice(0, 500) : JSON.stringify(body);
|
|
66
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* mcp-manager — stdio MCP server for Manager (newline-delimited JSON-RPC 2.0).
|
|
4
|
+
*
|
|
5
|
+
* Reads MANAGER_URL and MANAGER_TOKEN (an API token created under Account → Agents).
|
|
6
|
+
* The token decides who acts, in which workspace, and whether writes are allowed.
|
|
7
|
+
* Logs go to stderr; stdout carries only JSON-RPC.
|
|
8
|
+
*/
|
|
9
|
+
import { createInterface } from "node:readline";
|
|
10
|
+
import { ManagerClient } from "./client.js";
|
|
11
|
+
import { handle } from "./server.js";
|
|
12
|
+
import { TOOLS } from "./tools.js";
|
|
13
|
+
const log = (msg) => process.stderr.write(`mcp-manager: ${msg}\n`);
|
|
14
|
+
const baseUrl = process.env.MANAGER_URL ?? "https://manager.glie.ai";
|
|
15
|
+
const token = process.env.MANAGER_TOKEN ?? "";
|
|
16
|
+
if (!token) {
|
|
17
|
+
log("MANAGER_TOKEN is not set. Create a token in Manager under Account → Agents.");
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
const client = new ManagerClient(baseUrl, token);
|
|
21
|
+
const send = (msg) => process.stdout.write(`${JSON.stringify(msg)}\n`);
|
|
22
|
+
log(`starting against ${baseUrl}`);
|
|
23
|
+
const rl = createInterface({ input: process.stdin, crlfDelay: Number.POSITIVE_INFINITY });
|
|
24
|
+
rl.on("line", async (line) => {
|
|
25
|
+
if (!line.trim())
|
|
26
|
+
return;
|
|
27
|
+
let req;
|
|
28
|
+
try {
|
|
29
|
+
req = JSON.parse(line);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
send({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "parse error" } });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const res = await handle(req, TOOLS, client);
|
|
36
|
+
if (res)
|
|
37
|
+
send(res);
|
|
38
|
+
});
|
|
39
|
+
rl.on("close", () => log("stdin closed, exiting"));
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { describe } from "./client.js";
|
|
2
|
+
import { INSTRUCTIONS } from "./tools.js";
|
|
3
|
+
/** Keep in step with "version" in package.json on each release. */
|
|
4
|
+
export const SERVER_VERSION = "0.1.0";
|
|
5
|
+
const ok = (id, result) => ({
|
|
6
|
+
jsonrpc: "2.0",
|
|
7
|
+
id,
|
|
8
|
+
result,
|
|
9
|
+
});
|
|
10
|
+
const fail = (id, code, message) => ({
|
|
11
|
+
jsonrpc: "2.0",
|
|
12
|
+
id,
|
|
13
|
+
error: { code, message },
|
|
14
|
+
});
|
|
15
|
+
const text = (value) => [{ type: "text", text: JSON.stringify(value, null, 2) }];
|
|
16
|
+
/**
|
|
17
|
+
* One MCP request in, at most one response out (notifications get none).
|
|
18
|
+
* A refused API call is a tool result with isError, carrying the API's own reason, so the
|
|
19
|
+
* model reads "This token is read-only" rather than a protocol failure.
|
|
20
|
+
*/
|
|
21
|
+
export async function handle(req, tools, client) {
|
|
22
|
+
const id = req.id ?? null;
|
|
23
|
+
switch (req.method) {
|
|
24
|
+
case "initialize":
|
|
25
|
+
return ok(id, {
|
|
26
|
+
protocolVersion: "2024-11-05",
|
|
27
|
+
capabilities: { tools: {} },
|
|
28
|
+
serverInfo: { name: "mcp-manager", version: SERVER_VERSION },
|
|
29
|
+
instructions: INSTRUCTIONS,
|
|
30
|
+
});
|
|
31
|
+
case "notifications/initialized":
|
|
32
|
+
case "initialized":
|
|
33
|
+
return null;
|
|
34
|
+
case "ping":
|
|
35
|
+
return ok(id, {});
|
|
36
|
+
case "tools/list":
|
|
37
|
+
return ok(id, {
|
|
38
|
+
tools: tools.map(({ name, description, inputSchema }) => ({
|
|
39
|
+
name,
|
|
40
|
+
description,
|
|
41
|
+
inputSchema,
|
|
42
|
+
})),
|
|
43
|
+
});
|
|
44
|
+
case "tools/call": {
|
|
45
|
+
const name = req.params?.name;
|
|
46
|
+
const args = (req.params?.arguments ?? {});
|
|
47
|
+
const tool = tools.find((t) => t.name === name);
|
|
48
|
+
if (!tool)
|
|
49
|
+
return fail(id, -32602, `unknown tool: ${String(name)}`);
|
|
50
|
+
try {
|
|
51
|
+
const { status, body } = await tool.call(client, args);
|
|
52
|
+
if (status >= 400) {
|
|
53
|
+
return ok(id, { content: text({ status, error: describe(body) }), isError: true });
|
|
54
|
+
}
|
|
55
|
+
const data = body && typeof body === "object" && "data" in body ? body.data : body;
|
|
56
|
+
return ok(id, { content: text(data) });
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
return ok(id, { content: text({ error: err.message }), isError: true });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
default:
|
|
63
|
+
if (req.id === undefined)
|
|
64
|
+
return null; // an unknown notification needs no answer
|
|
65
|
+
return fail(id, -32601, `method not found: ${req.method}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
const str = (description) => ({ type: "string", description });
|
|
2
|
+
const int = (description) => ({ type: "integer", description });
|
|
3
|
+
const bool = (description) => ({ type: "boolean", description });
|
|
4
|
+
const strList = (description) => ({
|
|
5
|
+
type: "array",
|
|
6
|
+
items: { type: "string" },
|
|
7
|
+
description,
|
|
8
|
+
});
|
|
9
|
+
const oneOf = (values, description) => ({
|
|
10
|
+
type: "string",
|
|
11
|
+
enum: values,
|
|
12
|
+
description,
|
|
13
|
+
});
|
|
14
|
+
const obj = (properties, required = []) => ({
|
|
15
|
+
type: "object",
|
|
16
|
+
properties,
|
|
17
|
+
...(required.length ? { required } : {}),
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
});
|
|
20
|
+
/** The arguments in `keys` that the caller actually sent. */
|
|
21
|
+
function pick(args, keys) {
|
|
22
|
+
const out = {};
|
|
23
|
+
for (const key of keys)
|
|
24
|
+
if (args[key] !== undefined)
|
|
25
|
+
out[key] = args[key];
|
|
26
|
+
return out;
|
|
27
|
+
}
|
|
28
|
+
const seg = (value) => encodeURIComponent(String(value));
|
|
29
|
+
const taskPath = (args, rest = "") => `/tasks/${seg(args.taskId)}${rest}`;
|
|
30
|
+
const taskId = str("Task or meeting id (uuid).");
|
|
31
|
+
const idempotencyKey = str("Optional. A key unique to this creation (e.g. a uuid you generate once). Retrying with the same key returns the first result instead of creating a duplicate.");
|
|
32
|
+
const TASK_FIELDS = {
|
|
33
|
+
name: str("Title, up to 200 characters."),
|
|
34
|
+
description: str("Rich-text HTML description."),
|
|
35
|
+
meeting: bool("true for a meeting, false (default) for a task."),
|
|
36
|
+
dateDeadline: str("Deadline day, YYYY-MM-DD. Required on create; for a meeting, its day."),
|
|
37
|
+
allDay: bool("Meetings default to false (timed). Tasks default to true."),
|
|
38
|
+
datetimeDeadlineStart: str("ISO 8601 start, e.g. 2026-11-09T10:00:00Z. Required for timed meetings."),
|
|
39
|
+
datetimeDeadlineEnd: str("ISO 8601 end; must be after the start."),
|
|
40
|
+
duration: { type: "number", description: "Duration in hours." },
|
|
41
|
+
location: str("Where it happens."),
|
|
42
|
+
videocallLocation: str("Video call URL."),
|
|
43
|
+
privacy: oneOf(["public", "private"], "private: only the responsible and participants see it."),
|
|
44
|
+
state: oneOf(["pending", "placeholder"], "pending (default) or placeholder (not yet firm)."),
|
|
45
|
+
managerId: str("Responsible person: a member's userId from manager_people_list, or 'current_user'. Assigning someone else starts a handshake they must accept."),
|
|
46
|
+
ownerId: str("Owner contact id (may be an external contact). Defaults to you."),
|
|
47
|
+
participantIds: strList("Contact ids of the participants (contacts from manager_people_list)."),
|
|
48
|
+
tagIds: strList("Tag ids from manager_tag_list."),
|
|
49
|
+
teamId: str("Team id from manager_team_list; you must belong to the team."),
|
|
50
|
+
reschedulesAllowed: int("How many times it may be rescheduled before needing approval."),
|
|
51
|
+
};
|
|
52
|
+
const TASK_FIELD_NAMES = Object.keys(TASK_FIELDS);
|
|
53
|
+
export const INSTRUCTIONS = [
|
|
54
|
+
"Manager is where Glie runs its day-to-day operation: tasks, meetings and their follow-ups. You act as the person whose API token you hold, in one workspace, with their role and visibility — nothing more. Every manager_* tool wraps one REST call.",
|
|
55
|
+
"",
|
|
56
|
+
"START HERE:",
|
|
57
|
+
"• manager_me — who you act as, your role, and whether the token can write.",
|
|
58
|
+
"• The day: manager_task_list { from: <today>, to: <today> } (add meeting: true for meetings only), plus manager_task_list { overdue: true } for what slipped.",
|
|
59
|
+
"• manager_attention — counts of overdue items and unread notifications; manager_notification_list for the details.",
|
|
60
|
+
"",
|
|
61
|
+
"MODEL:",
|
|
62
|
+
"• A task and a meeting are the same object; meeting: true makes it a meeting (timed, with participants, agenda and follow-ups).",
|
|
63
|
+
"• States: placeholder (not firm) → pending → done | cancelled. Done and cancelled are read-only until manager_task_reopen.",
|
|
64
|
+
"• People: managerId is the responsible member (a userId). ownerId and participantIds are contacts — members have a contact too, and contacts may be external.",
|
|
65
|
+
"• Handshake: giving a task to someone else (as a plain member) leaves it pending their acceptance; they answer with manager_task_handshake. Nothing else moves while it is pending.",
|
|
66
|
+
"• Rescheduling is governed: each task allows a number of reschedules. Past it, manager_task_reschedule with requestOnly: true asks the responsible person instead.",
|
|
67
|
+
"• Completing is refused while steps, agenda items or follow-ups are still pending, and a meeting needs at least one participant. Finish or remove those first.",
|
|
68
|
+
"• Follow-ups are tasks linked to a meeting (manager_followup_create creates and links one).",
|
|
69
|
+
"",
|
|
70
|
+
"CONVENTIONS: dates are YYYY-MM-DD; times are ISO 8601 with offset. Pass idempotencyKey when creating, so a retry never duplicates. A 403 means the person may not do it (or the token is read-only); a 404 means it does not exist or is not visible to them.",
|
|
71
|
+
].join("\n");
|
|
72
|
+
export const TOOLS = [
|
|
73
|
+
{
|
|
74
|
+
name: "manager_me",
|
|
75
|
+
description: "Who you act as: the person, and the token's name, scope (read|write), workspace and role.",
|
|
76
|
+
inputSchema: obj({}),
|
|
77
|
+
call: (c) => c.request("GET", "/api/me"),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "manager_attention",
|
|
81
|
+
description: "Counts that need action now: your overdue tasks and unread notifications.",
|
|
82
|
+
inputSchema: obj({}),
|
|
83
|
+
call: async (c) => c.request("GET", await c.workspacePath("/badge-counts")),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "manager_people_list",
|
|
87
|
+
description: "Members (with userId for managerId, role, and their contact) and every contact (for ownerId and participantIds).",
|
|
88
|
+
inputSchema: obj({}),
|
|
89
|
+
call: async (c) => {
|
|
90
|
+
const [members, contacts] = await Promise.all([
|
|
91
|
+
c.request("GET", await c.workspacePath("/members")),
|
|
92
|
+
c.request("GET", await c.workspacePath("/contacts")),
|
|
93
|
+
]);
|
|
94
|
+
const failed = [members, contacts].find((r) => r.status >= 400);
|
|
95
|
+
if (failed)
|
|
96
|
+
return failed;
|
|
97
|
+
const data = (r) => r.body.data;
|
|
98
|
+
return { status: 200, body: { data: { members: data(members), contacts: data(contacts) } } };
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "manager_contact_create",
|
|
103
|
+
description: "Add a contact (e.g. an external participant). Workspace admins only.",
|
|
104
|
+
inputSchema: obj({ name: str("Full name."), email: str("Email address.") }, ["name", "email"]),
|
|
105
|
+
call: async (c, a) => c.request("POST", await c.workspacePath("/contacts"), { body: pick(a, ["name", "email"]) }),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "manager_tag_list",
|
|
109
|
+
description: "Tags of the workspace.",
|
|
110
|
+
inputSchema: obj({}),
|
|
111
|
+
call: async (c) => c.request("GET", await c.workspacePath("/tags")),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "manager_team_list",
|
|
115
|
+
description: "Teams you belong to.",
|
|
116
|
+
inputSchema: obj({}),
|
|
117
|
+
call: async (c) => c.request("GET", await c.workspacePath("/teams/my")),
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "manager_report_get",
|
|
121
|
+
description: "Performance report for a period (completion, on-time and reschedule rates). Defaults to the last 7 days.",
|
|
122
|
+
inputSchema: obj({ from: str("First day, YYYY-MM-DD."), to: str("Last day, YYYY-MM-DD.") }),
|
|
123
|
+
call: async (c, a) => c.request("GET", await c.workspacePath("/reports"), { query: pick(a, ["from", "to"]) }),
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "manager_task_list",
|
|
127
|
+
description: "List tasks and meetings visible to you, newest first. Combine filters to get a day, a week, or what is overdue.",
|
|
128
|
+
inputSchema: obj({
|
|
129
|
+
from: str("Deadline on or after this day, YYYY-MM-DD."),
|
|
130
|
+
to: str("Deadline on or before this day, YYYY-MM-DD."),
|
|
131
|
+
overdue: bool("Only pending items whose deadline has passed."),
|
|
132
|
+
meeting: bool("true: meetings only; false: tasks only."),
|
|
133
|
+
state: oneOf(["placeholder", "pending", "done", "cancelled"], "Only this state."),
|
|
134
|
+
q: str("Name contains this text."),
|
|
135
|
+
managed: bool("Only items you are responsible for or own."),
|
|
136
|
+
myTasks: bool("Only items where you are a participant."),
|
|
137
|
+
limit: int("Up to 500; default 100."),
|
|
138
|
+
offset: int("For paging."),
|
|
139
|
+
}),
|
|
140
|
+
call: async (c, a) => c.request("GET", await c.workspacePath("/tasks"), {
|
|
141
|
+
query: pick(a, [
|
|
142
|
+
"from",
|
|
143
|
+
"to",
|
|
144
|
+
"overdue",
|
|
145
|
+
"meeting",
|
|
146
|
+
"state",
|
|
147
|
+
"q",
|
|
148
|
+
"managed",
|
|
149
|
+
"myTasks",
|
|
150
|
+
"limit",
|
|
151
|
+
"offset",
|
|
152
|
+
]),
|
|
153
|
+
}),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "manager_task_get",
|
|
157
|
+
description: "One task or meeting in full: people, participants and their RSVP, tags.",
|
|
158
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
159
|
+
call: async (c, a) => c.request("GET", await c.workspacePath(taskPath(a))),
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "manager_task_create",
|
|
163
|
+
description: "Create a task or a meeting. Requires name and dateDeadline; meetings also need datetimeDeadlineStart unless allDay.",
|
|
164
|
+
inputSchema: obj({ ...TASK_FIELDS, idempotencyKey }, ["name", "dateDeadline"]),
|
|
165
|
+
call: async (c, a) => c.request("POST", await c.workspacePath("/tasks"), {
|
|
166
|
+
body: { managerId: "current_user", ...pick(a, TASK_FIELD_NAMES) },
|
|
167
|
+
idempotencyKey: a.idempotencyKey,
|
|
168
|
+
}),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "manager_task_update",
|
|
172
|
+
description: "Change fields of a pending task or meeting. Send only what changes. For a recurring series, recurringUpdate 'all' also applies safe fields to the coming occurrences. To move a date, prefer manager_task_reschedule.",
|
|
173
|
+
inputSchema: obj({
|
|
174
|
+
taskId,
|
|
175
|
+
...TASK_FIELDS,
|
|
176
|
+
recurringUpdate: oneOf(["this", "all"], "Recurring series: this occurrence or all."),
|
|
177
|
+
}, ["taskId"]),
|
|
178
|
+
call: async (c, a) => c.request("PATCH", await c.workspacePath(taskPath(a)), {
|
|
179
|
+
body: pick(a, [...TASK_FIELD_NAMES, "recurringUpdate"]),
|
|
180
|
+
}),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "manager_task_complete",
|
|
184
|
+
description: "Mark done. On the last occurrence of a recurring series it first answers with a terminationWarning; repeat with bypassTerminationCheck: true to confirm.",
|
|
185
|
+
inputSchema: obj({ taskId, bypassTerminationCheck: bool("Confirm ending a series.") }, [
|
|
186
|
+
"taskId",
|
|
187
|
+
]),
|
|
188
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, "/complete")), {
|
|
189
|
+
body: pick(a, ["bypassTerminationCheck"]),
|
|
190
|
+
}),
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: "manager_task_cancel",
|
|
194
|
+
description: "Cancel with a reason. If you may not cancel it yourself, this sends a cancellation request to the responsible person.",
|
|
195
|
+
inputSchema: obj({
|
|
196
|
+
taskId,
|
|
197
|
+
reason: str("Why, up to 200 characters."),
|
|
198
|
+
recurringAction: oneOf(["cancel_only", "cancel_create_next"], "Recurring: also create the next occurrence?"),
|
|
199
|
+
}, ["taskId", "reason"]),
|
|
200
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, "/cancel")), {
|
|
201
|
+
body: pick(a, ["reason", "recurringAction"]),
|
|
202
|
+
}),
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "manager_task_reopen",
|
|
206
|
+
description: "Bring a done or cancelled item back to pending.",
|
|
207
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
208
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, "/reopen")), { body: {} }),
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "manager_task_reschedule",
|
|
212
|
+
description: "Move to a new day (and time, for timed meetings). Counts against the reschedule limit of tasks; past the limit, use requestOnly: true to ask the responsible person.",
|
|
213
|
+
inputSchema: obj({
|
|
214
|
+
taskId,
|
|
215
|
+
newDate: str("New day, YYYY-MM-DD, not in the past."),
|
|
216
|
+
newDatetimeStart: str("Timed meetings: new ISO start, on newDate."),
|
|
217
|
+
newDatetimeEnd: str("Timed meetings: new ISO end, on newDate."),
|
|
218
|
+
reason: str("Why, up to 500 characters."),
|
|
219
|
+
requestOnly: bool("Ask the responsible person instead of moving it."),
|
|
220
|
+
}, ["taskId", "newDate"]),
|
|
221
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, "/reschedule")), {
|
|
222
|
+
body: pick(a, ["newDate", "newDatetimeStart", "newDatetimeEnd", "reason", "requestOnly"]),
|
|
223
|
+
}),
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "manager_task_reschedule_history",
|
|
227
|
+
description: "Every reschedule of an item: from, to, when, by whom and why.",
|
|
228
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
229
|
+
call: async (c, a) => c.request("GET", await c.workspacePath(taskPath(a, "/reschedule"))),
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "manager_task_handshake",
|
|
233
|
+
description: "Accept or reject a task someone assigned to you.",
|
|
234
|
+
inputSchema: obj({
|
|
235
|
+
taskId,
|
|
236
|
+
action: oneOf(["accept", "reject"], "Your answer."),
|
|
237
|
+
reason: str("Why, when rejecting."),
|
|
238
|
+
}, ["taskId", "action"]),
|
|
239
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, "/handshake")), {
|
|
240
|
+
body: pick(a, ["action", "reason"]),
|
|
241
|
+
}),
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "manager_meeting_rsvp",
|
|
245
|
+
description: "Answer a meeting invitation you are a participant of.",
|
|
246
|
+
inputSchema: obj({ taskId, responseStatus: oneOf(["accepted", "declined", "tentative"], "Your answer.") }, ["taskId", "responseStatus"]),
|
|
247
|
+
call: async (c, a) => c.request("PATCH", await c.workspacePath(taskPath(a, "/rsvp")), {
|
|
248
|
+
body: pick(a, ["responseStatus"]),
|
|
249
|
+
}),
|
|
250
|
+
},
|
|
251
|
+
...checklist("step", "steps", "stepId", "Checklist step of a task", {
|
|
252
|
+
completed: bool("Tick or untick the step."),
|
|
253
|
+
}),
|
|
254
|
+
...checklist("agenda", "agenda", "agendaId", "Agenda item of a meeting", {
|
|
255
|
+
state: oneOf(["pending", "delayed", "done", "cancelled"], "Item state."),
|
|
256
|
+
}),
|
|
257
|
+
{
|
|
258
|
+
name: "manager_followup_list",
|
|
259
|
+
description: "Follow-ups of a meeting, each with its linked task.",
|
|
260
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
261
|
+
call: async (c, a) => c.request("GET", await c.workspacePath(taskPath(a, "/followups"))),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: "manager_followup_create",
|
|
265
|
+
description: "Add a follow-up to a meeting: either link an existing task (followupTaskId) or create a new one (name, managerId, dateDeadline…).",
|
|
266
|
+
inputSchema: obj({
|
|
267
|
+
taskId: str("The meeting's id."),
|
|
268
|
+
followupTaskId: str("Link this existing task instead of creating one."),
|
|
269
|
+
name: str("New follow-up task's title."),
|
|
270
|
+
description: str("New task's description."),
|
|
271
|
+
managerId: str("Responsible member's userId, or 'current_user'."),
|
|
272
|
+
ownerId: str("Owner contact id."),
|
|
273
|
+
dateDeadline: str("YYYY-MM-DD."),
|
|
274
|
+
meeting: bool("Create the follow-up as a meeting."),
|
|
275
|
+
idempotencyKey,
|
|
276
|
+
}, ["taskId"]),
|
|
277
|
+
call: async (c, a) => {
|
|
278
|
+
const body = a.followupTaskId
|
|
279
|
+
? pick(a, ["followupTaskId"])
|
|
280
|
+
: {
|
|
281
|
+
managerId: "current_user",
|
|
282
|
+
...pick(a, ["name", "description", "managerId", "ownerId", "dateDeadline", "meeting"]),
|
|
283
|
+
};
|
|
284
|
+
return c.request("POST", await c.workspacePath(taskPath(a, "/followups")), {
|
|
285
|
+
body,
|
|
286
|
+
idempotencyKey: a.idempotencyKey,
|
|
287
|
+
});
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: "manager_followup_update",
|
|
292
|
+
description: "Set a follow-up's state.",
|
|
293
|
+
inputSchema: obj({
|
|
294
|
+
taskId: str("The meeting's id."),
|
|
295
|
+
followupId: str("Follow-up id from manager_followup_list."),
|
|
296
|
+
state: oneOf(["pending", "scheduled", "rescheduled", "delayed", "done", "cancelled"], "New state."),
|
|
297
|
+
}, ["taskId", "followupId", "state"]),
|
|
298
|
+
call: async (c, a) => c.request("PATCH", await c.workspacePath(taskPath(a, `/followups/${seg(a.followupId)}`)), {
|
|
299
|
+
body: pick(a, ["state"]),
|
|
300
|
+
}),
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: "manager_followup_remove",
|
|
304
|
+
description: "Unlink a follow-up from a meeting.",
|
|
305
|
+
inputSchema: obj({ taskId: str("The meeting's id."), followupId: str("Follow-up id.") }, [
|
|
306
|
+
"taskId",
|
|
307
|
+
"followupId",
|
|
308
|
+
]),
|
|
309
|
+
call: async (c, a) => c.request("DELETE", await c.workspacePath(taskPath(a, `/followups/${seg(a.followupId)}`))),
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "manager_comment_list",
|
|
313
|
+
description: "Comments on a task or meeting, newest first.",
|
|
314
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
315
|
+
call: async (c, a) => c.request("GET", await c.workspacePath(taskPath(a, "/comments"))),
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "manager_comment_add",
|
|
319
|
+
description: "Comment on a task or meeting (up to 2000 characters).",
|
|
320
|
+
inputSchema: obj({ taskId, content: str("The comment."), idempotencyKey }, [
|
|
321
|
+
"taskId",
|
|
322
|
+
"content",
|
|
323
|
+
]),
|
|
324
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, "/comments")), {
|
|
325
|
+
body: pick(a, ["content"]),
|
|
326
|
+
idempotencyKey: a.idempotencyKey,
|
|
327
|
+
}),
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "manager_activity_list",
|
|
331
|
+
description: "What happened to an item, newest first: who did what, and through which token.",
|
|
332
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
333
|
+
call: async (c, a) => c.request("GET", await c.workspacePath(taskPath(a, "/activity"))),
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "manager_notification_list",
|
|
337
|
+
description: "Your notifications, newest first, with the unread count.",
|
|
338
|
+
inputSchema: obj({ unread: bool("Only unread."), limit: int("Up to 50; default 20.") }),
|
|
339
|
+
call: async (c, a) => c.request("GET", await c.workspacePath("/notifications"), {
|
|
340
|
+
query: pick(a, ["unread", "limit"]),
|
|
341
|
+
}),
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "manager_notification_mark_read",
|
|
345
|
+
description: "Mark notifications as read: some by id, or all of them.",
|
|
346
|
+
inputSchema: obj({
|
|
347
|
+
notificationIds: strList("Ids to mark read (up to 100)."),
|
|
348
|
+
markAllRead: bool("Mark every notification read."),
|
|
349
|
+
}),
|
|
350
|
+
call: async (c, a) => c.request("PATCH", await c.workspacePath("/notifications"), {
|
|
351
|
+
body: pick(a, ["notificationIds", "markAllRead"]),
|
|
352
|
+
}),
|
|
353
|
+
},
|
|
354
|
+
];
|
|
355
|
+
/** list/add/update/remove for the two checklists that live inside a task: steps and agenda. */
|
|
356
|
+
function checklist(noun, route, idName, what, extra) {
|
|
357
|
+
const itemPath = (a) => taskPath(a, `/${route}/${seg(a[idName])}`);
|
|
358
|
+
const id = str(`${what} id, from manager_${noun}_list.`);
|
|
359
|
+
return [
|
|
360
|
+
{
|
|
361
|
+
name: `manager_${noun}_list`,
|
|
362
|
+
description: `${what}s, in order.`,
|
|
363
|
+
inputSchema: obj({ taskId }, ["taskId"]),
|
|
364
|
+
call: async (c, a) => c.request("GET", await c.workspacePath(taskPath(a, `/${route}`))),
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: `manager_${noun}_add`,
|
|
368
|
+
description: `Add a ${what.toLowerCase()}.`,
|
|
369
|
+
inputSchema: obj({ taskId, name: str("Text, up to 200 characters."), sequence: int("Position.") }, ["taskId", "name"]),
|
|
370
|
+
call: async (c, a) => c.request("POST", await c.workspacePath(taskPath(a, `/${route}`)), {
|
|
371
|
+
body: pick(a, ["name", "sequence"]),
|
|
372
|
+
}),
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
name: `manager_${noun}_update`,
|
|
376
|
+
description: `Rename, reorder or change the state of a ${what.toLowerCase()}.`,
|
|
377
|
+
inputSchema: obj({ taskId, [idName]: id, name: str("New text."), sequence: int("Position."), ...extra }, ["taskId", idName]),
|
|
378
|
+
call: async (c, a) => c.request("PATCH", await c.workspacePath(itemPath(a)), {
|
|
379
|
+
body: pick(a, ["name", "sequence", ...Object.keys(extra)]),
|
|
380
|
+
}),
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
name: `manager_${noun}_remove`,
|
|
384
|
+
description: `Delete a ${what.toLowerCase()}.`,
|
|
385
|
+
inputSchema: obj({ taskId, [idName]: id }, ["taskId", idName]),
|
|
386
|
+
call: async (c, a) => c.request("DELETE", await c.workspacePath(itemPath(a))),
|
|
387
|
+
},
|
|
388
|
+
];
|
|
389
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glie/mcp-manager",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Model Context Protocol (stdio) server exposing Manager, glie's tasks and meetings product, as native tools in Claude Code and any MCP client.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "glie <carlos@glie.ai>",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-manager": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/glieai/manager.git",
|
|
21
|
+
"directory": "packages/mcp-manager"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://manager.glie.ai",
|
|
24
|
+
"keywords": ["mcp", "model-context-protocol", "claude", "claude-code", "manager", "glie"],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"bundle": "tsc -p tsconfig.build.json && chmod +x dist/index.js",
|
|
27
|
+
"prepublishOnly": "npm run bundle"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^22.10.5",
|
|
31
|
+
"typescript": "^5.7.2"
|
|
32
|
+
}
|
|
33
|
+
}
|