clokio-mcp 0.27.0 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,7 +65,7 @@ acting. An explicit code on a tool call always takes precedence.
65
65
 
66
66
  Optional: set `CLOKIO_TOOLSETS` to register only the tool groups you need, e.g.
67
67
  `CLOKIO_TOOLSETS=tasks`. This cuts the per-session tool-list cost - a
68
- task-focused session drops from 127 tools to 40. Optional groups are `tasks`,
68
+ task-focused session drops from 129 tools to 42. Optional groups are `tasks`,
69
69
  `employees`, `attendance` (which includes leave, time entries and logging time), `docs` and
70
70
  `tickets`;
71
71
  combine them with commas. If your key cannot open documents (no acts-as
@@ -76,13 +76,13 @@ through it.
76
76
 
77
77
  ## Tools
78
78
 
79
- 127 tools across seven areas. Read-only tools carry the MCP `readOnlyHint`; writes
79
+ 129 tools across seven areas. Read-only tools carry the MCP `readOnlyHint`; writes
80
80
  are marked mutating (deletes are `destructive`).
81
81
 
82
82
  | Area | Tools |
83
83
  |------|-------|
84
- | **Tasks** | list (with `compact` / `sort` / `updated_since` / `updated_before` / `recurring`, no due date, no assignee, a custom field value, title-only search), a project's task summary (counts by status / priority / label / assignee, overdue and stale lists, per option of a release dropdown: `clokio_get_project_task_summary`), a project's activity log (`clokio_list_project_activity`), get (with `comments_limit`; names the ticket a task was opened from), create, update (incl. recurring series: set a rule, pause/resume, stop; labels: replace, add, remove; parent task; assignees in the same call), delete, bulk update (status, priority, due date, estimate, add / remove labels), set assignees (a shared board's client people as `{employee_code, organization_id}`), list a board's people, list/add/edit comments, list attachments (with `is_latest` + `latest_only`), upload, download one (save to disk, or read PDF text / ZIP entries / images / text inline), download all to a folder, read images pasted into descriptions and comments, activity (with organisations, paged), list/add/remove dependencies, set custom field (an option by value or label), set custom fields on many tasks (`clokio_bulk_set_task_custom_field`, partial success); `clokio_update_task` takes `custom_fields` too |
85
- | **Projects & clients** | list projects, project statuses (and create / edit them), project custom fields (and create / edit them, e.g. a release dropdown), project contacts, get client, add client contact |
84
+ | **Tasks** | list (with `compact` / `fields` / `sort` / `updated_since` / `updated_before` / `recurring`, no due date, no assignee, a custom field value, title-only search), a project's task summary (counts by status / priority / label / assignee, overdue and stale lists, per option of a release dropdown: `clokio_get_project_task_summary`), a project's activity log (`clokio_list_project_activity`), get (with `comments_limit`; names the ticket a task was opened from), create, update (incl. recurring series: set a rule, pause/resume, stop; labels: replace, add, remove; parent task; assignees in the same call), delete, bulk update (status, priority, due date, estimate, add / remove labels), set assignees (a shared board's client people as `{employee_code, organization_id}`), list a board's people, list/add/edit comments, list attachments (with `is_latest` + `latest_only`), upload, download one (save to disk, or read PDF text / ZIP entries / images / text inline), download all to a folder, read images pasted into descriptions and comments, activity (with organisations, paged), list/add/remove dependencies, set custom field (an option by value or label), set custom fields on many tasks (`clokio_bulk_set_task_custom_field`, partial success); `clokio_update_task` takes `custom_fields` too |
85
+ | **Projects & clients** | list projects, project statuses (and create / edit / delete them; a status in use moves its tasks to `move_to`), project custom fields (and create / edit / delete them, e.g. a release dropdown; a delete removes the stored values too), project contacts, get client, add client contact |
86
86
  | **Reference** | task statuses, task labels, locations, list webhooks (read-only), whoami |
87
87
  | **Employees** | list (name search), lookup by PIN, task-stats, inbox (mentions, new assignments, others' status changes; with the tickets toolset, also the acting employee's open tickets), create, set status |
88
88
  | **Attendance** | daily, range, per-employee, monthly summary, clock in/out, break start/end, time entries (local times in the person's zone; edit / delete your own), leaves (with `days`, half days counted 0.5), days of leave taken per type and year (`clokio_get_leave_days_taken`; the old name `clokio_get_leave_balances` still works; Clokio tracks no quota or remaining balance; leave and time-entry lists take `employee_code` and at most 92 days per call), **log time on a task**, start / stop / read the timer (see [Logging time](#logging-time)) |
@@ -32,7 +32,8 @@ export function registerProjectTools(server, config) {
32
32
  });
33
33
  // ── Board configuration writes (0.27.0, backend #5874 part 4) ──
34
34
  // projects:write. Every rule is the web editor's own copy on the server;
35
- // nothing is judged here beyond the shapes. No delete in this version.
35
+ // nothing is judged here beyond the shapes. Delete since 0.27.1 (backend
36
+ // #5874 QA round 1), with the web's delete rules on the server.
36
37
  const fieldOptions = z
37
38
  .array(z.object({
38
39
  value: z.string().min(1).max(100).describe('The stored value tasks hold; keep it stable'),
@@ -158,8 +159,8 @@ export function registerProjectTools(server, config) {
158
159
  mutates: true,
159
160
  description: 'Edit a project status by its slug (clokio_get_project_statuses): rename (the slug stays), recolour, ' +
160
161
  'move (position, 0-based; the completed status stays last) or change category. A status cannot become ' +
161
- 'a second completed one, and the completed one cannot become active. Statuses cannot be deleted ' +
162
- 'through the API. Needs the projects:write scope.',
162
+ 'a second completed one, and the completed one cannot become active. To remove a status use ' +
163
+ 'clokio_delete_project_status. Needs the projects:write scope.',
163
164
  schema: {
164
165
  project_id: z.number().int(),
165
166
  slug: z.string().regex(/^[A-Za-z0-9_-]{1,100}$/, 'slug: letters, digits, _ or -'),
@@ -184,6 +185,70 @@ export function registerProjectTools(server, config) {
184
185
  return request(cfg, `/projects/${args.project_id}/statuses/${args.slug}`, { method: 'PATCH', body });
185
186
  },
186
187
  });
188
+ registerTool(server, config, {
189
+ name: 'clokio_delete_project_status',
190
+ mutates: 'destructive',
191
+ description: 'Delete a project status by its slug (clokio_get_project_statuses), with the web editor\'s rules. The ' +
192
+ 'DEFAULT status (where new tasks start) and the COMPLETED status cannot be deleted. When tasks still use ' +
193
+ 'the status, move_to is REQUIRED: another slug of the same project, of the SAME kind (an active status ' +
194
+ 'for an active one); every task on the deleted status ' +
195
+ '(deleted tasks included) moves there in the same step, and each move is written to that task\'s ' +
196
+ 'activity log, credited to the actor. Without move_to the server answers how many tasks use it and ' +
197
+ 'deletes nothing. A project still using the organisation\'s statuses gets its own copy only when the ' +
198
+ 'delete happens, so no other project changes. Needs the projects:write scope.',
199
+ schema: {
200
+ project_id: z.number().int(),
201
+ slug: z.string().regex(/^[A-Za-z0-9_-]{1,100}$/, 'slug: letters, digits, _ or -'),
202
+ move_to: z
203
+ .string()
204
+ .regex(/^[A-Za-z0-9_-]{1,100}$/, 'move_to: a status slug')
205
+ .optional()
206
+ .describe('Where the tasks on this status go: another slug of the same project. Required when any task uses it'),
207
+ actor_employee_code: actorCode,
208
+ },
209
+ handler: (args, cfg) => {
210
+ if (args.move_to !== undefined && args.move_to === args.slug) {
211
+ throw new Error('move_to must be another status, not the one being deleted.');
212
+ }
213
+ const body = {};
214
+ if (args.move_to !== undefined)
215
+ body.move_to = args.move_to;
216
+ const actor = args.actor_employee_code ?? cfg.defaultActor;
217
+ if (actor)
218
+ body.actor_employee_code = actor;
219
+ return request(cfg, `/projects/${args.project_id}/statuses/${args.slug}`, { method: 'DELETE', body });
220
+ },
221
+ });
222
+ registerTool(server, config, {
223
+ name: 'clokio_delete_project_custom_field',
224
+ mutates: 'destructive',
225
+ description: 'Delete a project custom field by its field_key, with the web editor\'s rule: the field is removed ' +
226
+ 'TOGETHER WITH every value stored for it on every task, and this cannot be undone; there is no archive. ' +
227
+ 'A field that holds any value needs confirm: true: without it the server answers how many tasks hold a ' +
228
+ 'value and deletes nothing. A field with no values deletes without confirm. The answer says how many ' +
229
+ 'tasks held a value (affected_task_count). Check usage first with clokio_list_tasks custom_field or ' +
230
+ 'clokio_get_project_task_summary group_by_custom_field when that matters. A private field answers not ' +
231
+ 'found. Needs the projects:write scope.',
232
+ schema: {
233
+ project_id: z.number().int(),
234
+ field_key: z.string().regex(FIELD_KEY_PATTERN, 'field_key: letters, digits, _ or -'),
235
+ confirm: z
236
+ .boolean()
237
+ .optional()
238
+ .describe('true = delete the field AND every value stored for it. Required when the field holds any value; ' +
239
+ 'omit it first to learn how many tasks hold one'),
240
+ actor_employee_code: actorCode,
241
+ },
242
+ handler: (args, cfg) => {
243
+ const body = {};
244
+ if (args.confirm !== undefined)
245
+ body.confirm = args.confirm;
246
+ const actor = args.actor_employee_code ?? cfg.defaultActor;
247
+ if (actor)
248
+ body.actor_employee_code = actor;
249
+ return request(cfg, `/projects/${args.project_id}/custom-fields/${args.field_key}`, { method: 'DELETE', body });
250
+ },
251
+ });
187
252
  registerTool(server, config, {
188
253
  name: 'clokio_get_project_contacts',
189
254
  description: "The contacts for a project's client.",
@@ -337,6 +337,25 @@ export function withLinkedTicket(task) {
337
337
  * 422 are refused here first, in the same words, so no request is spent on
338
338
  * them.
339
339
  */
340
+ /**
341
+ * The keys `fields` may name on GET /tasks (0.27.1, backend #5874 QA round 1):
342
+ * the compact row's keys plus custom_fields. The server's own list is
343
+ * PublicTaskResource::SELECTABLE_FIELDS; an unknown name is its 422.
344
+ */
345
+ export const TASK_LIST_FIELDS = [
346
+ 'id',
347
+ 'title',
348
+ 'status',
349
+ 'priority',
350
+ 'due_date',
351
+ 'parent_id',
352
+ 'project_id',
353
+ 'assignee_codes',
354
+ 'external_assignees',
355
+ 'labels',
356
+ 'updated_at',
357
+ 'custom_fields',
358
+ ];
340
359
  export function listFilterQuery(args) {
341
360
  if (args.no_due_date === true && (args.due_before !== undefined || args.due_after !== undefined)) {
342
361
  throw new Error('no_due_date=true cannot be combined with due_before or due_after: a task with no due date is never due before or after anything. Drop one of them.');
@@ -456,6 +475,14 @@ export function registerTaskTools(server, config) {
456
475
  'and updated_at - dropping the HTML description and flattening the nested project/assignee ' +
457
476
  'objects to ids. Resolve a project_id with clokio_list_projects, and fetch the one task you ' +
458
477
  'actually need in full with clokio_get_task (its URL is /tasks/{id}/view).'),
478
+ fields: z
479
+ .array(z.enum(TASK_LIST_FIELDS))
480
+ .min(1)
481
+ .max(TASK_LIST_FIELDS.length)
482
+ .optional()
483
+ .describe('Return ONLY these keys per row, in this order (implies compact), e.g. ["id", "title", "status"]. ' +
484
+ 'Allowed: ' + TASK_LIST_FIELDS.join(', ') + '. custom_fields is the full row\'s object of public ' +
485
+ 'field values. The smallest scan there is.'),
459
486
  sort: z
460
487
  .enum([
461
488
  'due_date',
@@ -497,6 +524,7 @@ export function registerTaskTools(server, config) {
497
524
  cursor: args.cursor,
498
525
  sort: args.sort,
499
526
  compact: args.compact === undefined ? undefined : args.compact ? 1 : 0,
527
+ fields: args.fields === undefined ? undefined : [...new Set(args.fields)].join(','),
500
528
  },
501
529
  }),
502
530
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clokio-mcp",
3
- "version": "0.27.0",
3
+ "version": "0.27.1",
4
4
  "description": "Model Context Protocol (MCP) server for Clokio - manage tasks, projects, clients, employees, attendance and documents from Claude and any MCP client.",
5
5
  "type": "module",
6
6
  "bin": {