Skip to content

Commit bca4335

Browse files
ktamas77claude
andcommitted
docs(readme): document entries edit / entries delete + new MCP tools
Adds the CLI examples, the authorization rule (token must own / session / admin), and the two new MCP tool rows (`update_entry`, `delete_entry`). Also two example prompts that exercise the new tools. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d0cb0ca commit bca4335

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,18 @@ timebook log -p "Acme website" -t 1h30m -d "Code review"
5252
timebook log -p PROJ_ID --start 2026-05-04T09:00 --end 2026-05-04T10:30
5353

5454
timebook entries --project "Acme website" -n 10
55+
56+
# edit / delete (any combination of fields; unset ones stay as-is)
57+
timebook entries edit ENTRY_ID -t 2h -d "code review + tests"
58+
timebook entries edit ENTRY_ID --start 2026-05-04T09:00 --end 2026-05-04T11:00
59+
timebook entries edit ENTRY_ID -d "" # clear description
60+
timebook entries delete ENTRY_ID
5561
```
5662

5763
Duration formats accepted: `1h`, `45m`, `1h30m`, `1.5h`, `1:30`, or a bare number (interpreted as minutes — e.g. `90` → 1h 30m).
5864

65+
**Edit / delete authorization:** an API token can only modify entries it created itself. JWT sessions (the web UI) and admin tokens bypass this rule. Invoiced entries are locked for everyone via the API. A 403 with a friendly message is returned on a denied attempt — fix the entry from the web UI or with the token that created it.
66+
5967
## Use it as an MCP server
6068

6169
The same binary speaks MCP over stdio when invoked with `timebook mcp`. Drop it into any MCP-aware host (Claude Code, Claude Desktop, Codex, Cursor, …):
@@ -90,16 +98,18 @@ The MCP server reuses the token saved by `timebook login` — run `timebook logi
9098

9199
### Tools exposed to the model
92100

93-
| Tool | What it does |
94-
| ------------------ | ------------------------------------------------------------ |
95-
| `whoami` | Current authenticated user (read-only) |
96-
| `list_projects` | All projects in scope (read-only) |
97-
| `list_clients` | All clients in scope (read-only) |
98-
| `get_active_timer` | The running timer, or `null` (read-only) |
99-
| `start_timer` | Start a timer on a project |
100-
| `stop_timer` | Stop the running timer |
101-
| `log_time` | Log a manual entry (`duration` OR `startTime`+`endTime`) |
102-
| `list_entries` | Recent entries (default 50, max 500), project + date filters |
101+
| Tool | What it does |
102+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------- |
103+
| `whoami` | Current authenticated user (read-only) |
104+
| `list_projects` | All projects in scope (read-only) |
105+
| `list_clients` | All clients in scope (read-only) |
106+
| `get_active_timer` | The running timer, or `null` (read-only) |
107+
| `start_timer` | Start a timer on a project |
108+
| `stop_timer` | Stop the running timer |
109+
| `log_time` | Log a manual entry (`duration` OR `startTime`+`endTime`) |
110+
| `list_entries` | Recent entries (default 50, max 500), project + date filters |
111+
| `update_entry` | Edit one or more fields on an entry (description, duration, startTime, endTime, project, rate). Token must own the entry. |
112+
| `delete_entry` | Delete an entry. Token must own it. Invoiced entries are locked. |
103113

104114
### Try it with prompts
105115

@@ -110,6 +120,8 @@ Once the MCP server is connected, ask the model in plain English:
110120
- _"Log 1 hour 30 minutes against ChatNexus from 9am this morning at the Software Development rate, with description 'code review of the auth refactor'."_
111121
- _"What am I currently working on?"_ — invokes `get_active_timer`.
112122
- _"Stop my timer."_
123+
- _"My last entry on Recycler should be 2 hours, not 1h45m. Fix it."_ — invokes `list_entries` then `update_entry`.
124+
- _"Delete the entry I just made by mistake."_ — invokes `delete_entry`. Will 403 if the entry was created by a different token (web UI, another agent) — say so to the model so it doesn't keep retrying.
113125

114126
The model picks the right tool, asks `list_projects` first if it needs to disambiguate a name, and writes through `start_timer` / `log_time` / `stop_timer`.
115127

0 commit comments

Comments
 (0)