motionmcp 2.2.4 → 2.4.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/README.md +121 -164
- package/dist/handlers/ProjectHandler.js +4 -4
- package/dist/handlers/ProjectHandler.js.map +1 -1
- package/dist/handlers/RecurringTaskHandler.js +2 -2
- package/dist/handlers/RecurringTaskHandler.js.map +1 -1
- package/dist/handlers/SearchHandler.d.ts.map +1 -1
- package/dist/handlers/SearchHandler.js +20 -4
- package/dist/handlers/SearchHandler.js.map +1 -1
- package/dist/handlers/TaskHandler.d.ts.map +1 -1
- package/dist/handlers/TaskHandler.js +31 -5
- package/dist/handlers/TaskHandler.js.map +1 -1
- package/dist/mcp-server-old.d.ts +29 -0
- package/dist/mcp-server-old.d.ts.map +1 -0
- package/dist/mcp-server-old.js +1304 -0
- package/dist/mcp-server-old.js.map +1 -0
- package/dist/mcp-server.js +0 -0
- package/dist/services/motionApi.d.ts +11 -9
- package/dist/services/motionApi.d.ts.map +1 -1
- package/dist/services/motionApi.js +182 -120
- package/dist/services/motionApi.js.map +1 -1
- package/dist/tools/ToolDefinitions.d.ts.map +1 -1
- package/dist/tools/ToolDefinitions.js +9 -2
- package/dist/tools/ToolDefinitions.js.map +1 -1
- package/dist/types/mcp-tool-args.d.ts +2 -1
- package/dist/types/mcp-tool-args.d.ts.map +1 -1
- package/dist/types/mcp.d.ts +10 -0
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/jsonSchemaToZod.d.ts +33 -0
- package/dist/utils/jsonSchemaToZod.d.ts.map +1 -0
- package/dist/utils/jsonSchemaToZod.js +110 -0
- package/dist/utils/jsonSchemaToZod.js.map +1 -0
- package/dist/utils/paginationNew.d.ts +2 -0
- package/dist/utils/paginationNew.d.ts.map +1 -1
- package/dist/utils/paginationNew.js +10 -1
- package/dist/utils/paginationNew.js.map +1 -1
- package/dist/utils/responseFormatters.d.ts +9 -1
- package/dist/utils/responseFormatters.d.ts.map +1 -1
- package/dist/utils/responseFormatters.js +33 -7
- package/dist/utils/responseFormatters.js.map +1 -1
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +61 -0
- package/dist/worker.js.map +1 -0
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -3,15 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
# Motion MCP Server
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
[Motion](https://www.usemotion.com/) is an AI-powered calendar and task management app that auto-schedules your work. This MCP server bridges Motion's API with LLMs like Claude and ChatGPT via the [Model Context Protocol](https://modelcontextprotocol.io/docs/), so you can manage tasks, search projects, check your schedule, and more — all through natural conversation. It works on desktop, web, and mobile.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Preview
|
|
9
|
+
|
|
10
|
+
<a href="sample.png"><img src="sample.png" alt="Motion MCP Server Preview" width="400" /></a>
|
|
11
|
+
|
|
12
|
+
*Click the image above to view full size*
|
|
9
13
|
|
|
10
|
-
##
|
|
14
|
+
## Getting Started
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
**Prerequisites:** Node.js 18+ and a [Motion API key](https://app.usemotion.com/settings/api).
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
### Local Setup (npx)
|
|
19
|
+
|
|
20
|
+
For desktop MCP clients — Claude Desktop, Claude Code, Cursor, and similar.
|
|
21
|
+
|
|
22
|
+
Add to your `claude_desktop_config.json`:
|
|
15
23
|
|
|
16
24
|
```json
|
|
17
25
|
{
|
|
@@ -28,216 +36,159 @@ An MCP (Model Context Protocol) server that gives LLMs direct access to the Moti
|
|
|
28
36
|
}
|
|
29
37
|
```
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
Test from the command line:
|
|
32
40
|
|
|
33
41
|
```bash
|
|
34
|
-
MOTION_API_KEY=
|
|
42
|
+
MOTION_API_KEY=your_api_key npx motionmcp
|
|
35
43
|
```
|
|
36
44
|
|
|
37
|
-
> Tip
|
|
45
|
+
> **Tip:** `npx` always runs the latest published version — no install needed.
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
### Remote Setup (Cloudflare Workers)
|
|
40
48
|
|
|
41
|
-
|
|
49
|
+
For mobile and web clients — Claude mobile/web, ChatGPT mobile/web, or any HTTP MCP client.
|
|
42
50
|
|
|
43
|
-
|
|
51
|
+
#### One-click deploy
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/devondragon/MotionMCP)
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* Context utilities: semantic search and lightweight context summaries
|
|
51
|
-
* API key via environment variable
|
|
52
|
-
* Structured JSON logging
|
|
53
|
-
* **TypeScript** with strong types, validation, and robust error handling
|
|
55
|
+
After deploy, set your secrets in the Cloudflare dashboard (Workers > your worker > Settings > Variables):
|
|
56
|
+
- `MOTION_API_KEY` — your Motion API key
|
|
57
|
+
- `MOTION_MCP_SECRET` — a random string (generate with `openssl rand -hex 16`)
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* Node.js 18 or higher
|
|
58
|
-
|
|
59
|
-
## Tool Configuration
|
|
60
|
-
|
|
61
|
-
The server supports configurable tool sets to stay within MCP client limits (~100 tools across all servers). Configure via the `MOTION_MCP_TOOLS` environment variable:
|
|
62
|
-
|
|
63
|
-
### Configuration options
|
|
64
|
-
|
|
65
|
-
#### Minimal (3 tools)
|
|
66
|
-
Best for users who need only basic functionality and want to maximize room for other MCP servers.
|
|
59
|
+
#### Manual deploy
|
|
67
60
|
|
|
68
61
|
```bash
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
**Available tools:**
|
|
73
|
-
- `motion_tasks` - Task operations (create, list, get, update, delete, move, unassign)
|
|
74
|
-
- `motion_projects` - Project operations (create, list, get)
|
|
75
|
-
- `motion_workspaces` - Workspace management (list, get, set_default)
|
|
76
|
-
|
|
77
|
-
#### Essential (7 tools, default)
|
|
78
|
-
Balanced configuration with core functionality plus search, user management, and scheduling.
|
|
62
|
+
# Set secrets
|
|
63
|
+
npx wrangler secret put MOTION_API_KEY
|
|
64
|
+
npx wrangler secret put MOTION_MCP_SECRET # use: openssl rand -hex 16
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
npx motionmcp
|
|
83
|
-
# or explicitly:
|
|
84
|
-
MOTION_MCP_TOOLS=essential npx motionmcp
|
|
66
|
+
# Deploy
|
|
67
|
+
npm run worker:deploy
|
|
85
68
|
```
|
|
86
69
|
|
|
87
|
-
|
|
88
|
-
- All from Minimal, plus:
|
|
89
|
-
- `motion_users` - User operations (list, current)
|
|
90
|
-
- `motion_search` - Search and context utilities (content, context, smart)
|
|
91
|
-
- `motion_comments` - Comment management (list, create)
|
|
92
|
-
- `motion_schedules` - Schedule operations (list)
|
|
93
|
-
|
|
94
|
-
#### Complete (10 tools)
|
|
95
|
-
All consolidated tools for full Motion API access.
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
MOTION_MCP_TOOLS=complete npx motionmcp
|
|
70
|
+
Your MCP URL will be:
|
|
99
71
|
```
|
|
100
|
-
|
|
101
|
-
**Available tools:**
|
|
102
|
-
- All from Essential, plus:
|
|
103
|
-
- `motion_custom_fields` - Custom field management (list, create, delete, add/remove)
|
|
104
|
-
- `motion_recurring_tasks` - Recurring task management (list, create, delete)
|
|
105
|
-
- `motion_statuses` - Status operations (list)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
#### Custom
|
|
110
|
-
Specify exactly which tools you need.
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
MOTION_MCP_TOOLS=custom:motion_tasks,motion_projects,motion_search npx motionmcp
|
|
72
|
+
https://motion-mcp-server.YOUR_SUBDOMAIN.workers.dev/mcp/YOUR_SECRET
|
|
114
73
|
```
|
|
115
74
|
|
|
116
|
-
|
|
75
|
+
#### Connecting from Claude
|
|
117
76
|
|
|
118
|
-
|
|
77
|
+
1. Go to [claude.ai](https://claude.ai) > Settings > Connectors
|
|
78
|
+
2. Add your MCP URL
|
|
79
|
+
3. The server syncs automatically to the Claude mobile app
|
|
119
80
|
|
|
120
|
-
|
|
121
|
-
- Operations: `create`, `list`, `get`
|
|
122
|
-
- Example: `{"operation": "create", "name": "New Project", "workspaceName": "Personal"}`
|
|
81
|
+
#### Connecting from ChatGPT
|
|
123
82
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- Example: `{"operation": "create", "name": "New Task", "projectName": "My Project"}`
|
|
83
|
+
1. Go to ChatGPT Settings > Connectors
|
|
84
|
+
2. Add your MCP URL
|
|
127
85
|
|
|
128
|
-
|
|
129
|
-
- Operations: `list`, `create`
|
|
130
|
-
- Example: `{"operation": "create", "taskId": "task_123", "content": "Great progress!"}`
|
|
86
|
+
> **Security:** The secret in the URL prevents casual discovery. Treat the full URL like a password — don't share it publicly.
|
|
131
87
|
|
|
132
|
-
|
|
133
|
-
- Operations: `list`, `create`, `delete`, `add_to_project`, `remove_from_project`, `add_to_task`, `remove_from_task`
|
|
134
|
-
- Example: `{"operation": "create", "name": "Priority Level", "type": "DROPDOWN", "options": ["Low", "Medium", "High"]}`
|
|
88
|
+
Tool configuration works the same as the local server. Set `MOTION_MCP_TOOLS` in `wrangler.toml` under `[vars]`, or override via `wrangler secret put MOTION_MCP_TOOLS`.
|
|
135
89
|
|
|
136
|
-
|
|
137
|
-
- Operations: `list`, `create`, `delete`
|
|
138
|
-
- Example: `{"operation": "create", "name": "Weekly Review", "workspaceId": "ws_123", "assigneeId": "user_123", "frequency": {"type": "weekly", "daysOfWeek": [1,3,5] }, "duration": 30 }`
|
|
90
|
+
For local Worker development, see [DEVELOPER.md](./DEVELOPER.md).
|
|
139
91
|
|
|
140
|
-
|
|
92
|
+
### API Key
|
|
141
93
|
|
|
142
|
-
The
|
|
143
|
-
|
|
144
|
-
### 1. Environment Variable
|
|
94
|
+
The server reads your Motion API key from the `MOTION_API_KEY` environment variable.
|
|
145
95
|
|
|
96
|
+
**Inline (npx):**
|
|
146
97
|
```bash
|
|
147
98
|
MOTION_API_KEY=your-key npx motionmcp
|
|
148
99
|
```
|
|
149
100
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
Create a `.env` next to the project with:
|
|
153
|
-
|
|
101
|
+
**`.env` file (when running from source via npm):**
|
|
154
102
|
```bash
|
|
155
103
|
MOTION_API_KEY=your-key
|
|
156
104
|
```
|
|
157
105
|
|
|
158
|
-
> When using npx
|
|
159
|
-
|
|
160
|
-
## Tool Overview
|
|
161
|
-
|
|
162
|
-
### Context & Search
|
|
106
|
+
> When using `npx`, prefer the inline environment variable since `npx` won't read a local `.env` file.
|
|
163
107
|
|
|
164
|
-
|
|
108
|
+
## Tool Configuration
|
|
165
109
|
|
|
166
|
-
|
|
110
|
+
MCP clients have tool limits (~100 tools across all servers), so the server lets you control how many tools are exposed via the `MOTION_MCP_TOOLS` environment variable:
|
|
167
111
|
|
|
168
|
-
|
|
112
|
+
| Level | Tools | Description |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| **minimal** | 3 | Tasks, projects, workspaces only |
|
|
115
|
+
| **essential** (default) | 7 | Adds users, search, comments, schedules |
|
|
116
|
+
| **complete** | 10 | Full API access including custom fields, recurring tasks, statuses |
|
|
117
|
+
| **custom** | varies | Pick exactly the tools you need |
|
|
169
118
|
|
|
170
|
-
|
|
119
|
+
Custom example:
|
|
120
|
+
```bash
|
|
121
|
+
MOTION_MCP_TOOLS=custom:motion_tasks,motion_projects,motion_search npx motionmcp
|
|
122
|
+
```
|
|
171
123
|
|
|
172
|
-
|
|
124
|
+
## Tools Reference
|
|
173
125
|
|
|
174
|
-
###
|
|
126
|
+
### motion_tasks
|
|
127
|
+
**Operations:** `create`, `list`, `get`, `update`, `delete`, `move`, `unassign`
|
|
175
128
|
|
|
176
|
-
|
|
177
|
-
* `motion_custom_fields` — list, create, delete, add/remove on project or task
|
|
178
|
-
* `motion_recurring_tasks` — list, create, delete
|
|
129
|
+
The primary tool for task management. Supports all Motion API parameters including `name`, `description`, `priority`, `dueDate`, `duration`, `labels`, `assigneeId`, and `autoScheduled`. You can reference workspaces and projects by name — the server resolves them automatically.
|
|
179
130
|
|
|
180
|
-
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"operation": "create",
|
|
134
|
+
"name": "Complete API integration",
|
|
135
|
+
"workspaceName": "Development",
|
|
136
|
+
"projectName": "Release Cycle Q2",
|
|
137
|
+
"dueDate": "2025-06-15T09:00:00Z",
|
|
138
|
+
"priority": "HIGH",
|
|
139
|
+
"labels": ["api", "release"]
|
|
140
|
+
}
|
|
141
|
+
```
|
|
181
142
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
* `motion_schedules` — user schedules and time zones
|
|
185
|
-
* `motion_statuses` — available statuses by workspace
|
|
143
|
+
### motion_projects
|
|
144
|
+
**Operations:** `create`, `list`, `get`
|
|
186
145
|
|
|
187
|
-
|
|
146
|
+
Manage Motion projects. Workspace and project names are fuzzy-matched, and the server auto-selects your "Personal" workspace if none is specified.
|
|
188
147
|
|
|
189
|
-
|
|
148
|
+
```json
|
|
149
|
+
{"operation": "create", "name": "New Project", "workspaceName": "Personal"}
|
|
150
|
+
```
|
|
190
151
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
* Robust fallback and error messaging
|
|
152
|
+
### motion_workspaces
|
|
153
|
+
**Operations:** `list`, `get`, `set_default`
|
|
194
154
|
|
|
195
|
-
|
|
155
|
+
List and inspect workspaces, or set a default workspace for subsequent calls.
|
|
196
156
|
|
|
197
|
-
|
|
157
|
+
### motion_users
|
|
158
|
+
**Operations:** `list`, `current`
|
|
198
159
|
|
|
199
|
-
|
|
200
|
-
* Advanced: `priority`, `dueDate`, `duration`, `labels`, `assigneeId`, `autoScheduled`
|
|
160
|
+
List users in a workspace or get the current authenticated user.
|
|
201
161
|
|
|
202
|
-
###
|
|
162
|
+
### motion_search
|
|
163
|
+
**Operations:** `content`, `context`, `smart`
|
|
203
164
|
|
|
204
|
-
|
|
165
|
+
Cross-search tasks and projects by query with intelligent scope and priority boosting. The `context` operation returns a lightweight summary of your workspace (tasks, projects, schedules) — useful for giving an LLM situational awareness. The `smart` operation combines search with prioritized scheduling to surface what's most relevant.
|
|
205
166
|
|
|
206
|
-
|
|
167
|
+
```json
|
|
168
|
+
{"operation": "content", "query": "API integration", "workspaceName": "Development"}
|
|
169
|
+
```
|
|
207
170
|
|
|
208
|
-
|
|
209
|
-
|
|
171
|
+
### motion_comments
|
|
172
|
+
**Operations:** `list`, `create`
|
|
210
173
|
|
|
211
|
-
|
|
174
|
+
Read and add comments on tasks and projects.
|
|
212
175
|
|
|
213
|
-
### Creating a task with the consolidated tool
|
|
214
176
|
```json
|
|
215
|
-
|
|
216
|
-
Args: {
|
|
217
|
-
"operation": "create",
|
|
218
|
-
"name": "Complete API integration",
|
|
219
|
-
"workspaceName": "Development",
|
|
220
|
-
"projectName": "Release Cycle Q2",
|
|
221
|
-
"dueDate": "2025-06-15T09:00:00Z",
|
|
222
|
-
"priority": "HIGH",
|
|
223
|
-
"labels": ["api", "release"]
|
|
224
|
-
}
|
|
177
|
+
{"operation": "create", "taskId": "task_123", "content": "Updated the API endpoints as discussed"}
|
|
225
178
|
```
|
|
226
179
|
|
|
227
|
-
###
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
180
|
+
### motion_schedules
|
|
181
|
+
**Operations:** `list`
|
|
182
|
+
|
|
183
|
+
Retrieve user schedules and time zones. Supports prioritized scheduling with conflict detection and workload breakdowns by status, priority, and project.
|
|
184
|
+
|
|
185
|
+
### motion_custom_fields
|
|
186
|
+
**Operations:** `list`, `create`, `delete`, `add_to_project`, `remove_from_project`, `add_to_task`, `remove_from_task`
|
|
187
|
+
|
|
188
|
+
Define and manage custom fields across workspaces, projects, and tasks.
|
|
236
189
|
|
|
237
|
-
### Creating a custom field
|
|
238
190
|
```json
|
|
239
|
-
|
|
240
|
-
Args: {
|
|
191
|
+
{
|
|
241
192
|
"operation": "create",
|
|
242
193
|
"name": "Sprint",
|
|
243
194
|
"type": "DROPDOWN",
|
|
@@ -246,10 +197,13 @@ Args: {
|
|
|
246
197
|
}
|
|
247
198
|
```
|
|
248
199
|
|
|
249
|
-
###
|
|
200
|
+
### motion_recurring_tasks
|
|
201
|
+
**Operations:** `list`, `create`, `delete`
|
|
202
|
+
|
|
203
|
+
Manage recurring task templates.
|
|
204
|
+
|
|
250
205
|
```json
|
|
251
|
-
|
|
252
|
-
Args: {
|
|
206
|
+
{
|
|
253
207
|
"operation": "create",
|
|
254
208
|
"name": "Weekly Team Standup",
|
|
255
209
|
"recurrence": "WEEKLY",
|
|
@@ -259,7 +213,12 @@ Args: {
|
|
|
259
213
|
}
|
|
260
214
|
```
|
|
261
215
|
|
|
262
|
-
|
|
216
|
+
### motion_statuses
|
|
217
|
+
**Operations:** `list`
|
|
218
|
+
|
|
219
|
+
List available statuses for a workspace.
|
|
220
|
+
|
|
221
|
+
## Advanced Configuration
|
|
263
222
|
|
|
264
223
|
**Minimal setup (3 tools only):**
|
|
265
224
|
```json
|
|
@@ -310,15 +269,13 @@ Args: {
|
|
|
310
269
|
}
|
|
311
270
|
```
|
|
312
271
|
|
|
313
|
-
See the full developer setup
|
|
272
|
+
See the full developer setup in [DEVELOPER.md](./DEVELOPER.md).
|
|
314
273
|
|
|
315
274
|
## Debugging
|
|
316
275
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
## Logging Example
|
|
276
|
+
- Logs output to `stderr` in JSON format
|
|
277
|
+
- Check for missing keys, workspace/project names, and permissions
|
|
278
|
+
- Use `motion_workspaces` (list) and `motion_projects` (list) to validate IDs
|
|
322
279
|
|
|
323
280
|
```json
|
|
324
281
|
{
|
|
@@ -40,16 +40,16 @@ class ProjectHandler extends BaseHandler_1.BaseHandler {
|
|
|
40
40
|
async handleList(params) {
|
|
41
41
|
// If allWorkspaces is true and no specific workspace is provided, list all projects
|
|
42
42
|
if (params.allWorkspaces && !params.workspaceId && !params.workspaceName) {
|
|
43
|
-
const allProjects = await this.motionService.getAllProjects();
|
|
44
|
-
return (0, utils_1.formatProjectList)(allProjects, 'All Workspaces');
|
|
43
|
+
const { items: allProjects, truncation } = await this.motionService.getAllProjects();
|
|
44
|
+
return (0, utils_1.formatProjectList)(allProjects, 'All Workspaces', null, { truncation });
|
|
45
45
|
}
|
|
46
46
|
// Otherwise, use the existing single-workspace logic
|
|
47
47
|
const workspace = await this.workspaceResolver.resolveWorkspace({
|
|
48
48
|
workspaceId: params.workspaceId,
|
|
49
49
|
workspaceName: params.workspaceName
|
|
50
50
|
});
|
|
51
|
-
const projects = await this.motionService.getProjects(workspace.id);
|
|
52
|
-
return (0, utils_1.formatProjectList)(projects, workspace.name);
|
|
51
|
+
const { items: projects, truncation } = await this.motionService.getProjects(workspace.id);
|
|
52
|
+
return (0, utils_1.formatProjectList)(projects, workspace.name, null, { truncation });
|
|
53
53
|
}
|
|
54
54
|
async handleGet(params) {
|
|
55
55
|
if (!params.projectId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectHandler.js","sourceRoot":"","sources":["../../src/handlers/ProjectHandler.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AAGjD,oCAKkB;AAqBlB,MAAa,cAAe,SAAQ,yBAAW;IAC7C,KAAK,CAAC,MAAM,CAAC,IAAwB;QACnC,IAAI,CAAC;YACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;YAEtC,QAAO,SAAS,EAAE,CAAC;gBACjB,KAAK,QAAQ;oBACX,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,MAA6B,CAAC,CAAC;gBAChE,KAAK,MAAM;oBACT,OAAO,MAAM,IAAI,CAAC,UAAU,CA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B,EAAC,cAAc,EAAE,wBAAwB,cAAc,CAAC,IAAI,GAAG,CAAC,CAAC;IAC9F,CAAC;CACF;AAhED,wCAgEC"}
|
|
@@ -26,8 +26,8 @@ class RecurringTaskHandler extends BaseHandler_1.BaseHandler {
|
|
|
26
26
|
if (!args.workspaceId) {
|
|
27
27
|
return this.handleError(new Error('Workspace ID is required for list operation'));
|
|
28
28
|
}
|
|
29
|
-
const recurringTasks = await this.motionService.getRecurringTasks(args.workspaceId);
|
|
30
|
-
return (0, utils_1.formatRecurringTaskList)(recurringTasks);
|
|
29
|
+
const { items: recurringTasks, truncation } = await this.motionService.getRecurringTasks(args.workspaceId);
|
|
30
|
+
return (0, utils_1.formatRecurringTaskList)(recurringTasks, truncation);
|
|
31
31
|
}
|
|
32
32
|
async handleCreate(args) {
|
|
33
33
|
if (!args.name || !args.workspaceId || !args.assigneeId || !args.frequency) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecurringTaskHandler.js","sourceRoot":"","sources":["../../src/handlers/RecurringTaskHandler.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AAIjD,oCAAgG;AAEhG,MAAa,oBAAqB,SAAQ,yBAAW;IACnD,KAAK,CAAC,MAAM,CAAC,IAA8B;QACzC,IAAI,CAAC;YACH,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;YAE3B,QAAO,SAAS,EAAE,CAAC;gBACjB,KAAK,MAAM;oBACT,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBACrC,KAAK,QAAQ;oBACX,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;gBACvC,KAAK,QAAQ;oBACX,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;gBACvC;oBACE,OAAO,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YAC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lers/SearchHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"SearchHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/SearchHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAkB,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAqB1D,qBAAa,aAAc,SAAQ,WAAW;IACtC,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;YAmBhD,mBAAmB;YAmDnB,mBAAmB;YAyBnB,iBAAiB;CA8ChC"}
|
|
@@ -36,17 +36,33 @@ class SearchHandler extends BaseHandler_1.BaseHandler {
|
|
|
36
36
|
workspaceName: args.workspaceName
|
|
37
37
|
});
|
|
38
38
|
let results = [];
|
|
39
|
+
let mergedTruncation;
|
|
39
40
|
if (entityTypes.includes('tasks')) {
|
|
40
|
-
const tasks = await this.motionService.searchTasks(args.query, workspace.id, limit);
|
|
41
|
+
const { items: tasks, truncation } = await this.motionService.searchTasks(args.query, workspace.id, limit);
|
|
41
42
|
results.push(...tasks);
|
|
43
|
+
if (truncation?.wasTruncated && !mergedTruncation) {
|
|
44
|
+
mergedTruncation = truncation;
|
|
45
|
+
}
|
|
42
46
|
}
|
|
43
47
|
if (entityTypes.includes('projects')) {
|
|
44
|
-
const projects = await this.motionService.searchProjects(args.query, workspace.id, limit);
|
|
48
|
+
const { items: projects, truncation } = await this.motionService.searchProjects(args.query, workspace.id, limit);
|
|
45
49
|
results.push(...projects);
|
|
50
|
+
if (truncation?.wasTruncated && !mergedTruncation) {
|
|
51
|
+
mergedTruncation = truncation;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const slicedResults = results.slice(0, limit);
|
|
55
|
+
if (results.length > limit) {
|
|
56
|
+
// Combined results exceeded limit — report truncation for the combined result
|
|
57
|
+
mergedTruncation = { wasTruncated: true, returnedCount: slicedResults.length, reason: 'max_items', limit };
|
|
58
|
+
}
|
|
59
|
+
else if (mergedTruncation) {
|
|
60
|
+
mergedTruncation.returnedCount = slicedResults.length;
|
|
46
61
|
}
|
|
47
|
-
return (0, utils_1.formatSearchResults)(
|
|
62
|
+
return (0, utils_1.formatSearchResults)(slicedResults, args.query, {
|
|
48
63
|
limit,
|
|
49
|
-
searchScope: entityTypes.join(',') || 'both'
|
|
64
|
+
searchScope: entityTypes.join(',') || 'both',
|
|
65
|
+
truncation: mergedTruncation
|
|
50
66
|
});
|
|
51
67
|
}
|
|
52
68
|
async handleContextSearch(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchHandler.js","sourceRoot":"","sources":["../../src/handlers/SearchHandler.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AAGjD,oCAAyE;AAoBzE,MAAa,aAAc,SAAQ,yBAAW;IAC5C,KAAK,CAAC,MAAM,CAAC,IAAsB;QACjC,IAAI,CAAC;YACH,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;YAE3B,QAAO,SAAS,EAAE,CAAC;gBACjB,KAAK,SAAS;oBACZ,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,IAAyB,CAAC,CAAC;gBACnE,KAAK,SAAS;oBACZ,OAAO,MAAM,IAAI,CAAC,mBAAmB,CAAC,IAAyB,CAAC,CAAC;gBACnE,KAAK,OAAO;oBACV,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAuB,CAAC,CAAC;gBAC/D;oBACE,OAAO,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;I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Handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"TaskHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/TaskHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAqFzD;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA6B7D;;;;;;;;;;OAUG;YACW,YAAY;IAqE1B;;;;;;;;;OASG;YACW,UAAU;IAiGxB;;;;OAIG;YACW,SAAS;IASvB;;;;;;;;;OASG;YACW,YAAY;IA8C1B;;;;OAIG;YACW,YAAY;IAS1B;;;;;OAKG;YACW,UAAU;IAYxB;;;;OAIG;YACW,cAAc;IAS5B;;;;;OAKG;YACW,wBAAwB;IAetC;;;;;;;;;;OAUG;YACW,eAAe;IA6C7B;;;;;OAKG;YACW,sBAAsB;CAsFrC"}
|
|
@@ -62,6 +62,9 @@ class TaskHandler extends BaseHandler_1.BaseHandler {
|
|
|
62
62
|
if (!params.name) {
|
|
63
63
|
return this.handleError(new Error("Task name is required for create operation"));
|
|
64
64
|
}
|
|
65
|
+
if (Array.isArray(params.status)) {
|
|
66
|
+
return this.handleError(new Error("'status' must be a single string for create operation, not an array"));
|
|
67
|
+
}
|
|
65
68
|
const taskData = (0, utils_1.parseTaskArgs)(params);
|
|
66
69
|
const workspace = await this.workspaceResolver.resolveWorkspace(taskData);
|
|
67
70
|
// Resolve project identifier (projectId or projectName) using the centralized utility
|
|
@@ -144,6 +147,16 @@ class TaskHandler extends BaseHandler_1.BaseHandler {
|
|
|
144
147
|
return this.handleError(new Error(`Project with ${identifier} not found in any workspace`));
|
|
145
148
|
}
|
|
146
149
|
}
|
|
150
|
+
// Validate status array elements if provided as array
|
|
151
|
+
if (Array.isArray(params.status) && params.status.some(s => !s || typeof s !== 'string')) {
|
|
152
|
+
return this.handleError(new Error('status array must contain only non-empty strings'));
|
|
153
|
+
}
|
|
154
|
+
// Validate that status and includeAllStatuses are not combined
|
|
155
|
+
// An empty array is semantically "no filter" and should not trigger this error
|
|
156
|
+
const hasStatusFilter = Array.isArray(params.status) ? params.status.length > 0 : !!params.status;
|
|
157
|
+
if (params.includeAllStatuses && hasStatusFilter) {
|
|
158
|
+
return this.handleError(new Error("Cannot combine 'includeAllStatuses' with 'status' filter. Use one or the other."));
|
|
159
|
+
}
|
|
147
160
|
// Validate priority if provided
|
|
148
161
|
if (params.priority && !(0, constants_1.isValidPriority)(params.priority)) {
|
|
149
162
|
return this.handleError(new Error(`Invalid priority "${params.priority}". Valid values are: ASAP, HIGH, MEDIUM, LOW`));
|
|
@@ -162,24 +175,33 @@ class TaskHandler extends BaseHandler_1.BaseHandler {
|
|
|
162
175
|
return this.handleError(new Error('Labels must be an array of non-empty strings'));
|
|
163
176
|
}
|
|
164
177
|
const { resolvedId: resolvedAssigneeId, display: assigneeDisplay } = await this.resolveAssignee(params.assigneeId, params.assignee, workspace.id);
|
|
165
|
-
const tasks = await this.motionService.getTasks({
|
|
178
|
+
const { items: tasks, truncation } = await this.motionService.getTasks({
|
|
166
179
|
workspaceId: workspace.id,
|
|
167
180
|
projectId: resolvedProjectId,
|
|
168
181
|
status: params.status,
|
|
182
|
+
includeAllStatuses: params.includeAllStatuses,
|
|
169
183
|
assigneeId: resolvedAssigneeId,
|
|
170
184
|
priority: params.priority,
|
|
171
185
|
dueDate: validatedDueDate,
|
|
172
186
|
labels: params.labels,
|
|
173
187
|
limit: params.limit
|
|
174
188
|
});
|
|
189
|
+
const statusDisplay = params.includeAllStatuses
|
|
190
|
+
? 'all statuses'
|
|
191
|
+
: Array.isArray(params.status) && params.status.length > 0
|
|
192
|
+
? params.status.join(', ')
|
|
193
|
+
: typeof params.status === 'string'
|
|
194
|
+
? params.status
|
|
195
|
+
: undefined;
|
|
175
196
|
return (0, utils_1.formatTaskList)(tasks, {
|
|
176
197
|
workspaceName: workspace.name,
|
|
177
198
|
projectName: resolvedProjectName,
|
|
178
|
-
status:
|
|
199
|
+
status: statusDisplay,
|
|
179
200
|
assigneeName: assigneeDisplay || resolvedAssigneeId,
|
|
180
201
|
priority: params.priority,
|
|
181
202
|
dueDate: params.dueDate,
|
|
182
|
-
limit: params.limit
|
|
203
|
+
limit: params.limit,
|
|
204
|
+
truncation
|
|
183
205
|
});
|
|
184
206
|
}
|
|
185
207
|
/**
|
|
@@ -208,6 +230,9 @@ class TaskHandler extends BaseHandler_1.BaseHandler {
|
|
|
208
230
|
if (!params.taskId) {
|
|
209
231
|
return this.handleError(new Error("Task ID is required for update operation"));
|
|
210
232
|
}
|
|
233
|
+
if (Array.isArray(params.status)) {
|
|
234
|
+
return this.handleError(new Error("'status' must be a single string for update operation, not an array"));
|
|
235
|
+
}
|
|
211
236
|
// Create update object with only valid MotionTask fields
|
|
212
237
|
const updateData = {};
|
|
213
238
|
if (params.name !== undefined)
|
|
@@ -297,12 +322,13 @@ class TaskHandler extends BaseHandler_1.BaseHandler {
|
|
|
297
322
|
*/
|
|
298
323
|
async handleListAllUncompleted(params) {
|
|
299
324
|
const { resolvedId, display } = await this.resolveAssignee(params.assigneeId, params.assignee);
|
|
300
|
-
const tasks = await this.motionService.getAllUncompletedTasks(params.limit, resolvedId);
|
|
325
|
+
const { items: tasks, truncation } = await this.motionService.getAllUncompletedTasks(params.limit, resolvedId);
|
|
301
326
|
return (0, utils_1.formatTaskList)(tasks, {
|
|
302
327
|
status: 'uncompleted',
|
|
303
328
|
assigneeName: display || resolvedId,
|
|
304
329
|
limit: params.limit,
|
|
305
|
-
allWorkspaces: true
|
|
330
|
+
allWorkspaces: true,
|
|
331
|
+
truncation
|
|
306
332
|
});
|
|
307
333
|
}
|
|
308
334
|
/**
|