clokio-mcp 0.27.1 → 0.28.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/dist/tools/attendance.js +30 -11
- package/package.json +1 -1
package/dist/tools/attendance.js
CHANGED
|
@@ -56,7 +56,10 @@ export function entryClock(e, opts = {}) {
|
|
|
56
56
|
*/
|
|
57
57
|
export function timeEntryLine(e, opts = {}) {
|
|
58
58
|
const id = e?.id === undefined || e?.id === null ? '(no id: server older than 2026-10-16)' : `#${e.id}`;
|
|
59
|
-
|
|
59
|
+
// An entry may be on a project with no task (task #5775): name the project then.
|
|
60
|
+
const task = e?.task
|
|
61
|
+
? `task #${e.task.id} ${e.task.title}`
|
|
62
|
+
: e?.project?.name ? `no task, project ${e.project.name}` : 'no task';
|
|
60
63
|
return `${id} ${e?.date ?? '-'} ${entryClock(e, opts)} ${e?.work_hour ?? 0}h | ${e?.employee_code ?? '-'} | ${task} | ${e?.description ?? ''}`;
|
|
61
64
|
}
|
|
62
65
|
const ZONE_NOTE = "the person's CURRENT location zone, which clokio_update_time_entry reads date/start/end in (after a location change it may differ from where the entry was logged)";
|
|
@@ -405,19 +408,26 @@ export function registerAttendanceTools(server, config) {
|
|
|
405
408
|
'Needs the time_entries:write scope: Full access includes it; a key with chosen permissions must list it.';
|
|
406
409
|
const taskRule = 'The task must be one that person can view in your organisation, on an active project; a board another organisation ' +
|
|
407
410
|
'shared with you is refused (404).';
|
|
411
|
+
const targetRule = 'WHAT THE TIME IS ON, like the web Timer page (both optional): task_id, project_id, both, or neither. ' +
|
|
412
|
+
'Neither = a personal entry with no project (not billable). project_id alone = on that project with no task. ' +
|
|
413
|
+
"Both = the task decides and project_id must be the task's own project (refused otherwise). " +
|
|
414
|
+
"A project must be an active project of your organisation (clokio_list_projects). Entries hold no client: to log time for a client, use one of the client's projects. " +
|
|
415
|
+
taskRule;
|
|
408
416
|
registerTool(server, config, {
|
|
409
417
|
name: 'clokio_log_time',
|
|
410
|
-
description: 'Log a finished time entry on a task. ' + actingPerson + ' ' +
|
|
418
|
+
description: 'Log a finished time entry, on a task, a project, or neither. ' + actingPerson + ' ' +
|
|
411
419
|
'Times are local to that person (their location timezone, else UTC). Give EITHER date + start + end ' +
|
|
412
420
|
'(an end at or before start runs past midnight), OR date + start + duration_minutes, OR duration_minutes alone ' +
|
|
413
421
|
'(the entry then ENDS NOW and started that many minutes ago; date must be today or omitted). ' +
|
|
414
422
|
'At most 12 hours (720 minutes) per entry; nothing may start or end more than 10 minutes in the future; ' +
|
|
415
423
|
'an entry overlapping another time entry of the same person (including their running timer, and an overnight entry from the day before) is refused. ' +
|
|
416
|
-
'A duration counts real minutes across a DST change. ' +
|
|
417
|
-
"The project's billable flag is inherited and the description defaults to the task title. " +
|
|
424
|
+
'A duration counts real minutes across a DST change. ' + targetRule + ' ' +
|
|
425
|
+
"The project's billable flag is inherited (no project: not billable) and the description defaults to the task title (empty without a task). " +
|
|
418
426
|
ENTRY_LINE_NOTE,
|
|
419
427
|
schema: {
|
|
420
|
-
task_id: z.number().int().positive(),
|
|
428
|
+
task_id: z.number().int().positive().optional().describe('Optional. The task the time is on'),
|
|
429
|
+
project_id: z.number().int().positive().optional()
|
|
430
|
+
.describe("Optional. A project of your organisation; with task_id it must be the task's project"),
|
|
421
431
|
date: calendarDate('date').optional()
|
|
422
432
|
.describe('YYYY-MM-DD, the day the entry STARTS. Required with start'),
|
|
423
433
|
start: z.string().regex(/^\d{2}:\d{2}$/, 'start must be HH:MM').optional().describe('HH:MM, local time'),
|
|
@@ -441,6 +451,7 @@ export function registerAttendanceTools(server, config) {
|
|
|
441
451
|
method: 'POST',
|
|
442
452
|
body: {
|
|
443
453
|
task_id: args.task_id,
|
|
454
|
+
project_id: args.project_id,
|
|
444
455
|
date: args.date,
|
|
445
456
|
start: args.start,
|
|
446
457
|
end: args.end,
|
|
@@ -452,12 +463,16 @@ export function registerAttendanceTools(server, config) {
|
|
|
452
463
|
});
|
|
453
464
|
registerTool(server, config, {
|
|
454
465
|
name: 'clokio_start_timer',
|
|
455
|
-
description:
|
|
466
|
+
description: 'Start a running timer on a task, a project, or neither (a personal timer). ' + actingPerson + ' ' + targetRule + ' ' +
|
|
456
467
|
'If a timer is already running the call is refused (409) and the running entry is returned; ' +
|
|
457
|
-
'pass force: true to stop that timer and start this one. The description defaults to the task title. ' +
|
|
468
|
+
'pass force: true to stop that timer and start this one. The description defaults to the task title (empty without a task). ' +
|
|
469
|
+
'clokio_stop_timer stops any timer; the web Timer page asks for a project and a description before its own Stop, ' +
|
|
470
|
+
'so give a personal timer a description (and stop it here) if the person may stop it on the web. ' +
|
|
458
471
|
ENTRY_LINE_NOTE,
|
|
459
472
|
schema: {
|
|
460
|
-
task_id: z.number().int().positive(),
|
|
473
|
+
task_id: z.number().int().positive().optional().describe('Optional. The task the timer is on'),
|
|
474
|
+
project_id: z.number().int().positive().optional()
|
|
475
|
+
.describe("Optional. A project of your organisation; with task_id it must be the task's project"),
|
|
461
476
|
description: z.string().max(255).optional(),
|
|
462
477
|
force: z.boolean().optional().describe('Stop a running timer first instead of being refused'),
|
|
463
478
|
},
|
|
@@ -466,7 +481,7 @@ export function registerAttendanceTools(server, config) {
|
|
|
466
481
|
try {
|
|
467
482
|
return withEntryLine(await request(cfg, '/timer/start', {
|
|
468
483
|
method: 'POST',
|
|
469
|
-
body: { task_id: args.task_id, description: args.description, force: args.force },
|
|
484
|
+
body: { task_id: args.task_id, project_id: args.project_id, description: args.description, force: args.force },
|
|
470
485
|
}));
|
|
471
486
|
}
|
|
472
487
|
catch (e) {
|
|
@@ -502,7 +517,10 @@ export function registerAttendanceTools(server, config) {
|
|
|
502
517
|
registerTool(server, config, {
|
|
503
518
|
name: 'clokio_update_time_entry',
|
|
504
519
|
description: "Correct one of the time entries of the API key's ACTING person (another person's entry is \"Not found\"). " +
|
|
505
|
-
"Send only what changes: task_id (the entry moves to that task's project
|
|
520
|
+
"Send only what changes: task_id (the entry moves to that task's project; null unlinks the task and keeps the project), " +
|
|
521
|
+
'project_id (an active project of your organisation, or null to clear it; billable follows the project). ' +
|
|
522
|
+
"On an entry that is on a task, project_id must be the task's own project: to move it elsewhere send task_id: null with it. " +
|
|
523
|
+
'description (null or empty resets it to the task title, empty without a task), ' +
|
|
506
524
|
'and/or the time: date (YYYY-MM-DD), start, end (HH:MM, LOCAL to that person) or duration_minutes (alone it keeps the start and sets the length; start alone moves the entry and keeps its length). ' +
|
|
507
525
|
'Parts you leave out keep their current values. The same checks as clokio_log_time: at most 12 hours, nothing in the future, ' +
|
|
508
526
|
'no overlap with another entry of that person (their running timer included); an entry on an inactive project cannot change its time. ' +
|
|
@@ -510,7 +528,8 @@ export function registerAttendanceTools(server, config) {
|
|
|
510
528
|
'Needs time_entries:write.',
|
|
511
529
|
schema: {
|
|
512
530
|
id: z.number().int().positive().describe('The entry id (clokio_list_time_entries)'),
|
|
513
|
-
task_id: z.number().int().positive().optional(),
|
|
531
|
+
task_id: z.number().int().positive().nullable().optional().describe('A task to link, or null to unlink the task'),
|
|
532
|
+
project_id: z.number().int().positive().nullable().optional().describe('A project of your organisation, or null to clear it'),
|
|
514
533
|
date: calendarDate('date').optional(),
|
|
515
534
|
start: z.string().regex(/^\d{2}:\d{2}$/, 'start must be HH:MM').optional().describe('HH:MM, local time'),
|
|
516
535
|
end: z.string().regex(/^\d{2}:\d{2}$/, 'end must be HH:MM').optional().describe('HH:MM, local time. Not with duration_minutes'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clokio-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
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": {
|