obsidian-mcp-server 3.1.6 → 3.1.8
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/CLAUDE.md +1 -1
- package/README.md +22 -11
- package/changelog/3.1.x/3.1.7.md +41 -0
- package/changelog/3.1.x/3.1.8.md +27 -0
- package/dist/mcp-server/tools/definitions/index.d.ts +38 -0
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js +52 -18
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js +18 -6
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js +23 -3
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js +19 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js +21 -4
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js +18 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts +2 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js +35 -10
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/dist/services/obsidian/obsidian-service.d.ts +18 -10
- package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
- package/dist/services/obsidian/obsidian-service.js +64 -16
- package/dist/services/obsidian/obsidian-service.js.map +1 -1
- package/package.json +3 -3
- package/server.json +3 -3
package/CLAUDE.md
CHANGED
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](https://www.npmjs.com/package/obsidian-mcp-server) [](https://www.npmjs.com/package/obsidian-mcp-server) [](./CHANGELOG.md) [](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) [](https://modelcontextprotocol.io/)
|
|
11
11
|
|
|
12
12
|
[](./LICENSE) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
13
13
|
|
|
@@ -21,13 +21,13 @@ Fourteen tools grouped by shape — readers fetch notes and metadata, writers cr
|
|
|
21
21
|
|
|
22
22
|
| Tool Name | Description |
|
|
23
23
|
|:----------|:------------|
|
|
24
|
-
| `obsidian_get_note` | Read a note as raw content, full structured form (content + frontmatter + tags + stat), structural document map, or a single section. |
|
|
24
|
+
| `obsidian_get_note` | Read a note as raw content, full structured form (content + frontmatter + tags + stat, with optional outgoing links), structural document map, or a single section. |
|
|
25
25
|
| `obsidian_list_notes` | List notes and subdirectories at a vault path with a recursive walk (default depth 2 — structural overview; max 20) bounded by a 1000-entry cap. Optional `extension` and `nameRegex` filters apply across the tree; regex-filtered directories are skipped without recursing into them. Returns flat `entries[]` plus a box-drawing tree in the rendered output; per-directory `truncated: true` flags where the depth limit cut off recursion. |
|
|
26
26
|
| `obsidian_list_tags` | List every tag found across the vault with usage counts, including hierarchical parents. |
|
|
27
27
|
| `obsidian_list_commands` | List Obsidian command-palette commands available for execution. **Opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`** (paired with `obsidian_execute_command`). |
|
|
28
|
-
| `obsidian_search_notes` | Search the vault by text, Dataview DQL, or JSONLogic — capped at 100 hits with overflow indicator. |
|
|
28
|
+
| `obsidian_search_notes` | Search the vault by text, Dataview DQL, or JSONLogic. Text-mode matches return surrounding context windows (`contextLength`) — capped at 100 hits with overflow indicator. |
|
|
29
29
|
| `obsidian_write_note` | Create a note, replace a single section in place, or — with `overwrite: true` — clobber an existing file. Refuses whole-file writes against an existing path by default. |
|
|
30
|
-
| `obsidian_append_to_note` | Append content to a note
|
|
30
|
+
| `obsidian_append_to_note` | Append content to a note. Without `section` it creates the file if missing — your content becomes the entire file. With `section`, appends to that heading/block/frontmatter (PATCH; the file must exist). |
|
|
31
31
|
| `obsidian_patch_note` | Surgical `append` / `prepend` / `replace` against a heading, block reference, or frontmatter field. |
|
|
32
32
|
| `obsidian_replace_in_note` | Body-wide search-replace inside a single note. Literal or regex matching, with `wholeWord`, `flexibleWhitespace`, `caseSensitive`, `replaceAll`, and `$1`/`$&` capture groups. |
|
|
33
33
|
| `obsidian_manage_frontmatter` | Atomic `get` / `set` / `delete` on a single frontmatter key. |
|
|
@@ -41,7 +41,7 @@ Fourteen tools grouped by shape — readers fetch notes and metadata, writers cr
|
|
|
41
41
|
Read a note in one of four projections, addressed by vault path, the active file, or a periodic note (`daily`, `weekly`, `monthly`, `quarterly`, `yearly`).
|
|
42
42
|
|
|
43
43
|
- `format: "content"` — raw markdown body
|
|
44
|
-
- `format: "full"` — content, frontmatter, tags, and file metadata
|
|
44
|
+
- `format: "full"` — content, frontmatter, tags, and file metadata; pass `includeLinks: true` to also parse outgoing wiki and markdown link references from the body (vault-internal only — external URLs are filtered)
|
|
45
45
|
- `format: "document-map"` — catalog of headings, block references, and frontmatter fields
|
|
46
46
|
- `format: "section"` — single heading/block/frontmatter section value (requires `section`); heading sections include the full subtree under that heading
|
|
47
47
|
|
|
@@ -53,7 +53,7 @@ Pair the document-map projection with `obsidian_patch_note` to discover edit tar
|
|
|
53
53
|
|
|
54
54
|
Three search modes selected by `mode`:
|
|
55
55
|
|
|
56
|
-
- `text` — substring match with surrounding context windows;
|
|
56
|
+
- `text` — substring match with surrounding context windows. `contextLength` controls characters of context per side of each match (default 100; bump it for more context per hit). Optional `pathPrefix` filter (text mode only — passing `pathPrefix` in `dataview` or `jsonlogic` mode is rejected with `path_prefix_invalid_mode`).
|
|
57
57
|
- `dataview` — Dataview DQL (`TABLE …`) for path/date/metadata queries; `file.mtime`, `file.path`, etc. are queryable
|
|
58
58
|
- `jsonlogic` — JSONLogic tree evaluated against `path`, `content`, `frontmatter.<key>`, `tags`, and `stat.{ctime,mtime,size}`; custom `glob` and `regexp` operators
|
|
59
59
|
|
|
@@ -68,7 +68,18 @@ Create or surgically replace, with a protective default against accidental whole
|
|
|
68
68
|
- Without `section` — full-file `PUT`. **Refuses to clobber an existing file** unless `overwrite: true` is set. The `file_exists` (`Conflict`) error suggests `obsidian_patch_note` / `obsidian_append_to_note` / `obsidian_replace_in_note` for in-place edits.
|
|
69
69
|
- With `section` — `PATCH`-with-replace against the named heading/block/frontmatter field, leaving the rest of the file untouched. The `overwrite` flag is ignored in section mode.
|
|
70
70
|
|
|
71
|
-
The output reports `created: true` when the call brought a new file into existence; `false` when it replaced an existing one or targeted a section.
|
|
71
|
+
The output reports `created: true` when the call brought a new file into existence; `false` when it replaced an existing one or targeted a section. Every mutating tool also returns `previousSizeInBytes` and `currentSizeInBytes` so an agent can spot accidental clobbers, unexpected upstream behavior, or a typo path that landed at the wrong file.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### `obsidian_append_to_note`
|
|
76
|
+
|
|
77
|
+
A combined upsert + section-append primitive that mirrors the upstream Local REST API behavior:
|
|
78
|
+
|
|
79
|
+
- Without `section` — `POST` to `/vault/{path}`. Appends when the file exists, **creates the file with your content as the entire body when it doesn't.** The output's `created: true` flags the second branch so the agent can notice when a typo path or a not-yet-created daily note silently turned into a brand-new file.
|
|
80
|
+
- With `section` — `PATCH`-with-append against the named heading, block reference, or frontmatter field. The file must exist (PATCH preflight throws `note_missing` otherwise). Pass `createTargetIfMissing: true` to bring the section itself into existence inside an existing file. Block-reference targets concatenate adjacent to the block line without a separator — include a leading newline in `content` if you want one.
|
|
81
|
+
|
|
82
|
+
`previousSizeInBytes` is `0` on the upsert-create branch and the actual file size otherwise; `currentSizeInBytes` is the post-write size read from the upstream after the operation. Compare deltas against `Buffer.byteLength(content)` to detect auto-newline injection or concurrent writers.
|
|
72
83
|
|
|
73
84
|
---
|
|
74
85
|
|
|
@@ -114,7 +125,7 @@ Add, remove, or list tags on a note. Reconciles both representations:
|
|
|
114
125
|
|
|
115
126
|
### `obsidian_delete_note`
|
|
116
127
|
|
|
117
|
-
Permanently delete a note. When the client supports `elicit`, the server requests human confirmation before issuing the `DELETE
|
|
128
|
+
Permanently delete a note. When the client supports `elicit`, the server requests human confirmation before issuing the `DELETE` and the prompt includes the file's byte size — destructive blast radius visible before the user confirms. Without elicitation, the `destructiveHint` annotation surfaces the operation in the host's approval flow. The output reports `previousSizeInBytes` (size at the moment of deletion) and `currentSizeInBytes: 0`.
|
|
118
129
|
|
|
119
130
|
---
|
|
120
131
|
|
|
@@ -122,7 +133,7 @@ Permanently delete a note. When the client supports `elicit`, the server request
|
|
|
122
133
|
|
|
123
134
|
Dispatch an Obsidian command-palette command by ID (discoverable via `obsidian_list_commands`). Behavior is command-dependent — some commands open UI, others delete files or close the vault.
|
|
124
135
|
|
|
125
|
-
**Off by default.**
|
|
136
|
+
**Off by default.** When `OBSIDIAN_ENABLE_COMMANDS` is unset, both `obsidian_execute_command` and its discovery partner `obsidian_list_commands` are wrapped with `disabledTool()` — absent from `tools/list` (the LLM can't invoke them) but still visible in the operator-facing manifest with a hint to enable them.
|
|
126
137
|
|
|
127
138
|
---
|
|
128
139
|
|
|
@@ -141,7 +152,7 @@ Three optional env vars gate which vault paths each tool can target. **Default u
|
|
|
141
152
|
|
|
142
153
|
**Write paths are implicitly readable** — you can't sanely edit what you can't see. So a read passes when the target matches `READ_PATHS` *or* `WRITE_PATHS`.
|
|
143
154
|
|
|
144
|
-
**`OBSIDIAN_READ_ONLY=true` short-circuits before the path checks** — every write
|
|
155
|
+
**`OBSIDIAN_READ_ONLY=true` short-circuits before the path checks** — every write tool and the command-palette pair are wrapped with `disabledTool()` at startup (absent from `tools/list`), and any write that still reaches the service is denied at runtime regardless of `WRITE_PATHS`.
|
|
145
156
|
|
|
146
157
|
Denies are typed `path_forbidden` (JSON-RPC code `Forbidden`) with the active scope echoed back in `data.recovery.hint` and `data.activeScope`, so the LLM can self-correct without inspecting server logs. Search results from `obsidian_search_notes` are filtered against `READ_PATHS` silently — surfacing a "we hid N hits" indicator would defeat the gate.
|
|
147
158
|
|
|
@@ -155,7 +166,7 @@ The startup banner logs the active scope so operators can verify their config at
|
|
|
155
166
|
|:---|:---|:---|
|
|
156
167
|
| Resource | `obsidian://vault/{+path}` | A note in the vault — content, frontmatter, tags, and file metadata. |
|
|
157
168
|
| Resource | `obsidian://tags` | All tags found across the vault, with usage counts. |
|
|
158
|
-
| Resource | `obsidian://status` | Server reachability, plugin version, and
|
|
169
|
+
| Resource | `obsidian://status` | Server reachability, auth status, plugin/Obsidian version info, and the plugin manifest. |
|
|
159
170
|
|
|
160
171
|
All resource data is also reachable via tools — `obsidian_get_note` for `obsidian://vault/{+path}`, `obsidian_list_tags` for `obsidian://tags`. Resources exist for clients that prefer attaching a specific note or vault snapshot to a conversation.
|
|
161
172
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Every mutating tool now reports `previousSizeInBytes` + `currentSizeInBytes`; `obsidian_append_to_note` gains the `created` upsert flag. Resolves [#48](https://github.com/cyanheads/obsidian-mcp-server/issues/48)."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 3.1.7 — 2026-05-10
|
|
8
|
+
|
|
9
|
+
`obsidian_append_to_note` is silently an upsert primitive — POST against a non-existent path creates the file and writes the body as its full content. This release rolls the response-transparency pattern from `obsidian_write_note` onto every mutating tool: each one now reports byte-size before and after the operation, and the upsert tools flag whether the write created the file. Agents get unambiguous evidence to spot typo paths, accidental whole-file clobbers, and concurrent-writer drift from the response alone.
|
|
10
|
+
|
|
11
|
+
## Added
|
|
12
|
+
|
|
13
|
+
- **`obsidian_append_to_note`** — `created: boolean` on the output. `true` flags the upsert branch where the agent's content became the entire file at a possibly unintended path; `format()` renders the same hint as `obsidian_write_note` when set. Always `false` for section appends (PATCH requires the file to exist).
|
|
14
|
+
- **Every mutating tool** — `previousSizeInBytes` + `currentSizeInBytes` on the output. Server reports raw before/after; agent computes deltas and decides what discrepancies mean (auto-newline injection, concurrent writers, accidental shrinkage). No server-side integrity verdict.
|
|
15
|
+
- **`ObsidianService.tryGetSize(ctx, target)`** — HEAD `/vault/{path}`, parses `Content-Length`, returns `null` on 404. Path-policy gated, retry-bypassed.
|
|
16
|
+
- **`ObsidianService.getSize(ctx, target)`** — same as `tryGetSize` but throws `note_missing` on 404. Used for post-write verification reads.
|
|
17
|
+
|
|
18
|
+
## Changed
|
|
19
|
+
|
|
20
|
+
- **`obsidian_delete_note`** — elicitation prompt now includes the byte size of the file being deleted (`Permanently delete '<path>' (<N> bytes)?`).
|
|
21
|
+
- **`obsidian_write_note`** overwrite check migrated from `noteExists` to `tryGetSize !== null`. Net wash on round trips, gain the `previousSizeInBytes` data for free on the same HEAD.
|
|
22
|
+
- **`obsidian_append_to_note` description** — front-loads the create-if-missing behavior of the no-section branch (matches the wording pattern `obsidian_write_note` uses for `overwrite`).
|
|
23
|
+
- **Source-of-truth rule for note byte sizes** documented on `tryGetSize`: prefer HEAD `Content-Length` or `Buffer.byteLength(deliveredContent)`, never `note.stat.size` from the JSON envelope (shares the upstream `getAbstractFileByPath` cache path with the rest of the envelope, so it can't act as an independent cross-check — see [coddingtonbear/obsidian-local-rest-api#237](https://github.com/coddingtonbear/obsidian-local-rest-api/issues/237)).
|
|
24
|
+
- **`@biomejs/biome` `^2.4.14` → `^2.4.15`** (devDependency).
|
|
25
|
+
|
|
26
|
+
## Removed
|
|
27
|
+
|
|
28
|
+
- **`ObsidianService.noteExists`** — sole caller (`obsidian_write_note` overwrite guard) migrated to `tryGetSize`.
|
|
29
|
+
|
|
30
|
+
## Per-tool source for `currentSizeInBytes`
|
|
31
|
+
|
|
32
|
+
| Tool | Source | Extra round trips |
|
|
33
|
+
|:---|:---|:---|
|
|
34
|
+
| `obsidian_write_note` | Post-write HEAD (whole-file) / pre+post HEAD (section) | +1 / +2 |
|
|
35
|
+
| `obsidian_append_to_note` | Post-write HEAD (whole-file) / pre+post HEAD (section) | +1 / +2 |
|
|
36
|
+
| `obsidian_patch_note` | Pre+post HEAD | +2 |
|
|
37
|
+
| `obsidian_delete_note` | Always 0 (file gone); pre-DELETE HEAD also feeds the elicit prompt | +1 |
|
|
38
|
+
| `obsidian_replace_in_note` | `Buffer.byteLength` from existing GET; post-write HEAD only when matches found | 0 / +1 |
|
|
39
|
+
| `obsidian_manage_frontmatter` (`set`) | `Buffer.byteLength(noteAfter.content)` from existing post-PATCH GET | +1 (pre-PATCH HEAD) |
|
|
40
|
+
| `obsidian_manage_frontmatter` (`delete`) | `Buffer.byteLength` from existing GET; post-write HEAD only when content changed | 0 / +1 |
|
|
41
|
+
| `obsidian_manage_tags` (`add` / `remove`) | `Buffer.byteLength` from existing pre/post GETs | 0 |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "POST/PATCH bypass `withRetry` — prevents double-apply when a successful upstream write loses its response. Adds a 13-test regression suite covering the retry policy across every method."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 3.1.8 — 2026-05-11
|
|
8
|
+
|
|
9
|
+
`ObsidianService.#request` wrapped every call in `withRetry`. The framework's default `defaultIsTransient` predicate retries on 502/503/504/429 **and** raw network errors (`UND_ERR_SOCKET`, `ECONNRESET`, `ETIMEDOUT`, …) — fine for idempotent reads, but catastrophic for non-idempotent writes: an upstream that succeeded with a dropped response would double-apply on retry, duplicating an `append`, replaying a `patch` op, or re-running an arbitrary Obsidian command.
|
|
10
|
+
|
|
11
|
+
## Fixed
|
|
12
|
+
|
|
13
|
+
- **`ObsidianService.#request`** — POST/PATCH now bypass `withRetry` and propagate transient failures directly. Closes the data-corruption window on `obsidian_append_to_note`, `obsidian_patch_note` (`append`/`prepend`), `obsidian_execute_command`, `obsidian_open_in_ui`, and POST-mode `obsidian_search_notes`. Trade-off: those tools surface transient 5xx/network blips immediately rather than auto-retrying — agents must handle the first failure. Data integrity wins over single-call resilience for non-idempotent paths.
|
|
14
|
+
|
|
15
|
+
## Added
|
|
16
|
+
|
|
17
|
+
- **`RETRY_SAFE_METHODS`** — module-level `ReadonlySet<string>` of `{ GET, PUT, DELETE }`. Methods outside the set bypass the retry branch entirely.
|
|
18
|
+
- **`tests/services/obsidian-service.test.ts`** — 13 regression tests under `ObsidianService retry policy`, grouped into three describes:
|
|
19
|
+
- **POST/PATCH never retry on transient failures** — `appendToNote` / `patchNote` / `executeCommand` / `openInUi` against 503/504 and raw network errors (`UND_ERR_SOCKET`, `ECONNRESET`).
|
|
20
|
+
- **GET/PUT/DELETE retry on transient failures** — `getNoteContent` / `writeNote` / `deleteNote` against 503 and `ECONNRESET`, asserting the second attempt succeeds.
|
|
21
|
+
- **Non-transient errors do not retry, regardless of method** — 404/400/500 surface immediately.
|
|
22
|
+
- Helper `queueReplies(path, method, n, reply)` queues N identical intercepts so the attempt counter ticks per fetch (a single intercept would let retries fall through to "no intercept" and silently mask the bug).
|
|
23
|
+
|
|
24
|
+
## Changed
|
|
25
|
+
|
|
26
|
+
- **`tests/helpers.ts`** — exported `PathMatcher`, `DispatchOpts`, `DynamicReply`, `ReplyFn` (previously file-internal) so the retry-policy suite can type its intercept callbacks without redeclaring them.
|
|
27
|
+
- **`vitest` `^4.1.5` → `^4.1.6`** (devDependency).
|
|
@@ -284,6 +284,9 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
284
284
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
285
285
|
path: import("zod").ZodString;
|
|
286
286
|
sectionTargeted: import("zod").ZodBoolean;
|
|
287
|
+
created: import("zod").ZodBoolean;
|
|
288
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
289
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
287
290
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
288
291
|
readonly reason: "path_forbidden";
|
|
289
292
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -334,6 +337,8 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
334
337
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
335
338
|
path: import("zod").ZodString;
|
|
336
339
|
deleted: import("zod").ZodBoolean;
|
|
340
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
341
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
337
342
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
338
343
|
readonly reason: "path_forbidden";
|
|
339
344
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -400,11 +405,15 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
400
405
|
path: import("zod").ZodString;
|
|
401
406
|
key: import("zod").ZodString;
|
|
402
407
|
frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
408
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
409
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
403
410
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
404
411
|
operation: import("zod").ZodLiteral<"delete">;
|
|
405
412
|
path: import("zod").ZodString;
|
|
406
413
|
key: import("zod").ZodString;
|
|
407
414
|
frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
415
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
416
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
408
417
|
}, import("zod/v4/core").$strip>], "operation">;
|
|
409
418
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
410
419
|
readonly reason: "path_forbidden";
|
|
@@ -479,12 +488,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
479
488
|
applied: import("zod").ZodArray<import("zod").ZodString>;
|
|
480
489
|
skipped: import("zod").ZodArray<import("zod").ZodString>;
|
|
481
490
|
tags: import("zod").ZodArray<import("zod").ZodString>;
|
|
491
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
492
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
482
493
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
483
494
|
operation: import("zod").ZodLiteral<"remove">;
|
|
484
495
|
path: import("zod").ZodString;
|
|
485
496
|
applied: import("zod").ZodArray<import("zod").ZodString>;
|
|
486
497
|
skipped: import("zod").ZodArray<import("zod").ZodString>;
|
|
487
498
|
tags: import("zod").ZodArray<import("zod").ZodString>;
|
|
499
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
500
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
488
501
|
}, import("zod/v4/core").$strip>], "operation">;
|
|
489
502
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
490
503
|
readonly reason: "path_forbidden";
|
|
@@ -571,6 +584,8 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
571
584
|
append: "append";
|
|
572
585
|
prepend: "prepend";
|
|
573
586
|
}>;
|
|
587
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
588
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
574
589
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
575
590
|
readonly reason: "path_forbidden";
|
|
576
591
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -634,6 +649,8 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
634
649
|
search: import("zod").ZodString;
|
|
635
650
|
count: import("zod").ZodNumber;
|
|
636
651
|
}, import("zod/v4/core").$strip>>;
|
|
652
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
653
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
637
654
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
638
655
|
readonly reason: "path_forbidden";
|
|
639
656
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -699,6 +716,8 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
699
716
|
path: import("zod").ZodString;
|
|
700
717
|
sectionTargeted: import("zod").ZodBoolean;
|
|
701
718
|
created: import("zod").ZodBoolean;
|
|
719
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
720
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
702
721
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
703
722
|
readonly reason: "file_exists";
|
|
704
723
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
|
|
@@ -770,6 +789,9 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
770
789
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
771
790
|
path: import("zod").ZodString;
|
|
772
791
|
sectionTargeted: import("zod").ZodBoolean;
|
|
792
|
+
created: import("zod").ZodBoolean;
|
|
793
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
794
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
773
795
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
774
796
|
readonly reason: "path_forbidden";
|
|
775
797
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -820,6 +842,8 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
820
842
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
821
843
|
path: import("zod").ZodString;
|
|
822
844
|
deleted: import("zod").ZodBoolean;
|
|
845
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
846
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
823
847
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
824
848
|
readonly reason: "path_forbidden";
|
|
825
849
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -1041,11 +1065,15 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
1041
1065
|
path: import("zod").ZodString;
|
|
1042
1066
|
key: import("zod").ZodString;
|
|
1043
1067
|
frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
1068
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1069
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1044
1070
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
1045
1071
|
operation: import("zod").ZodLiteral<"delete">;
|
|
1046
1072
|
path: import("zod").ZodString;
|
|
1047
1073
|
key: import("zod").ZodString;
|
|
1048
1074
|
frontmatter: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
1075
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1076
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1049
1077
|
}, import("zod/v4/core").$strip>], "operation">;
|
|
1050
1078
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
1051
1079
|
readonly reason: "path_forbidden";
|
|
@@ -1120,12 +1148,16 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
1120
1148
|
applied: import("zod").ZodArray<import("zod").ZodString>;
|
|
1121
1149
|
skipped: import("zod").ZodArray<import("zod").ZodString>;
|
|
1122
1150
|
tags: import("zod").ZodArray<import("zod").ZodString>;
|
|
1151
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1152
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1123
1153
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
1124
1154
|
operation: import("zod").ZodLiteral<"remove">;
|
|
1125
1155
|
path: import("zod").ZodString;
|
|
1126
1156
|
applied: import("zod").ZodArray<import("zod").ZodString>;
|
|
1127
1157
|
skipped: import("zod").ZodArray<import("zod").ZodString>;
|
|
1128
1158
|
tags: import("zod").ZodArray<import("zod").ZodString>;
|
|
1159
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1160
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1129
1161
|
}, import("zod/v4/core").$strip>], "operation">;
|
|
1130
1162
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
1131
1163
|
readonly reason: "path_forbidden";
|
|
@@ -1230,6 +1262,8 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
1230
1262
|
append: "append";
|
|
1231
1263
|
prepend: "prepend";
|
|
1232
1264
|
}>;
|
|
1265
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1266
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1233
1267
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
1234
1268
|
readonly reason: "path_forbidden";
|
|
1235
1269
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -1293,6 +1327,8 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
1293
1327
|
search: import("zod").ZodString;
|
|
1294
1328
|
count: import("zod").ZodNumber;
|
|
1295
1329
|
}, import("zod/v4/core").$strip>>;
|
|
1330
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1331
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1296
1332
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
1297
1333
|
readonly reason: "path_forbidden";
|
|
1298
1334
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
@@ -1425,6 +1461,8 @@ export declare const baseToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
1425
1461
|
path: import("zod").ZodString;
|
|
1426
1462
|
sectionTargeted: import("zod").ZodBoolean;
|
|
1427
1463
|
created: import("zod").ZodBoolean;
|
|
1464
|
+
previousSizeInBytes: import("zod").ZodNumber;
|
|
1465
|
+
currentSizeInBytes: import("zod").ZodNumber;
|
|
1428
1466
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
1429
1467
|
readonly reason: "file_exists";
|
|
1430
1468
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH,gFAAgF;AAChF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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|
2
2
|
* @fileoverview obsidian_append_to_note — append content to the end of a note,
|
|
3
3
|
* or to the end of a heading/block/frontmatter section via PATCH-with-append.
|
|
4
|
+
* Whole-file appends are silently upserts (POST creates the file when the path
|
|
5
|
+
* does not exist), so the response surface flags `created` and `previousSize`
|
|
6
|
+
* for agent self-correction.
|
|
4
7
|
* @module mcp-server/tools/definitions/obsidian-append-to-note.tool
|
|
5
8
|
*/
|
|
6
9
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
@@ -39,6 +42,9 @@ export declare const obsidianAppendToNote: import("@cyanheads/mcp-ts-core").Tool
|
|
|
39
42
|
}, z.core.$strip>, z.ZodObject<{
|
|
40
43
|
path: z.ZodString;
|
|
41
44
|
sectionTargeted: z.ZodBoolean;
|
|
45
|
+
created: z.ZodBoolean;
|
|
46
|
+
previousSizeInBytes: z.ZodNumber;
|
|
47
|
+
currentSizeInBytes: z.ZodNumber;
|
|
42
48
|
}, z.core.$strip>, readonly [{
|
|
43
49
|
readonly reason: "path_forbidden";
|
|
44
50
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-append-to-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"obsidian-append-to-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4I/B,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview obsidian_append_to_note — append content to the end of a note,
|
|
3
3
|
* or to the end of a heading/block/frontmatter section via PATCH-with-append.
|
|
4
|
+
* Whole-file appends are silently upserts (POST creates the file when the path
|
|
5
|
+
* does not exist), so the response surface flags `created` and `previousSize`
|
|
6
|
+
* for agent self-correction.
|
|
4
7
|
* @module mcp-server/tools/definitions/obsidian-append-to-note.tool
|
|
5
8
|
*/
|
|
6
9
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
@@ -8,7 +11,7 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
8
11
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
9
12
|
import { ContentTypeSchema, SectionSchema, TargetSchema } from './_shared/schemas.js';
|
|
10
13
|
export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
11
|
-
description: 'Append content to a note. Without `section
|
|
14
|
+
description: 'Append content to a note. **Without `section`: appends to the end of the file, or creates the file if it does not exist (your content becomes the full file).** With `section`: appends to the end of that heading/block/frontmatter; nested headings need `Parent::Child` syntax — use `obsidian_get_note` with `format: "document-map"` to discover available targets. For block-reference targets, content is concatenated adjacent to the block line without inserting a separator — include a leading newline in `content` if you want one. Set `createTargetIfMissing` to bring the target section into existence rather than failing when it does not exist.',
|
|
12
15
|
annotations: { destructiveHint: true },
|
|
13
16
|
input: z.object({
|
|
14
17
|
target: TargetSchema.describe('Where the note lives.'),
|
|
@@ -24,7 +27,16 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
24
27
|
path: z.string().describe('Resolved vault-relative path of the note.'),
|
|
25
28
|
sectionTargeted: z
|
|
26
29
|
.boolean()
|
|
27
|
-
.describe('True when the append went to a section; false for whole-file appends.'),
|
|
30
|
+
.describe('True when the append went to a heading/block/frontmatter section (PATCH); false for whole-file appends (POST).'),
|
|
31
|
+
created: z
|
|
32
|
+
.boolean()
|
|
33
|
+
.describe('True when the whole-file append created a new file. Always false for section appends — PATCH requires the file to exist. Best-effort under concurrent writers, racy between the existence check and the write.'),
|
|
34
|
+
previousSizeInBytes: z
|
|
35
|
+
.number()
|
|
36
|
+
.describe('Byte size of the note before the append. Zero when `created` is true.'),
|
|
37
|
+
currentSizeInBytes: z
|
|
38
|
+
.number()
|
|
39
|
+
.describe('Byte size of the note after the append, read from the upstream after the operation completed. Compare against `previousSizeInBytes` and your own content length to detect unexpected upstream behavior (e.g. auto-newline injection, concurrent writers).'),
|
|
28
40
|
}),
|
|
29
41
|
auth: ['tool:obsidian_append_to_note:write'],
|
|
30
42
|
errors: [
|
|
@@ -67,9 +79,16 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
67
79
|
],
|
|
68
80
|
async handler(input, ctx) {
|
|
69
81
|
const svc = getObsidianService();
|
|
70
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Resolve once and pin the rest of the flow to a path target so the
|
|
84
|
+
* presence probe and the write itself act on the same concrete file —
|
|
85
|
+
* avoids re-resolving `active` / `periodic` targets across calls.
|
|
86
|
+
*/
|
|
87
|
+
const path = await svc.resolvePath(ctx, input.target);
|
|
88
|
+
const pathTarget = { type: 'path', path };
|
|
71
89
|
if (input.section) {
|
|
72
|
-
await svc.
|
|
90
|
+
const previousSizeInBytes = await svc.getSize(ctx, pathTarget);
|
|
91
|
+
await svc.patchNote(ctx, pathTarget, input.content, {
|
|
73
92
|
operation: 'append',
|
|
74
93
|
targetType: input.section.type,
|
|
75
94
|
target: input.section.target,
|
|
@@ -77,21 +96,36 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
77
96
|
createTargetIfMissing: input.createTargetIfMissing,
|
|
78
97
|
contentType: input.contentType,
|
|
79
98
|
});
|
|
80
|
-
const
|
|
81
|
-
return {
|
|
99
|
+
const currentSizeInBytes = await svc.getSize(ctx, pathTarget);
|
|
100
|
+
return {
|
|
101
|
+
path,
|
|
102
|
+
sectionTargeted: true,
|
|
103
|
+
created: false,
|
|
104
|
+
previousSizeInBytes,
|
|
105
|
+
currentSizeInBytes,
|
|
106
|
+
};
|
|
82
107
|
}
|
|
83
|
-
await svc.
|
|
84
|
-
|
|
85
|
-
|
|
108
|
+
const previousSizeInBytes = await svc.tryGetSize(ctx, pathTarget);
|
|
109
|
+
await svc.appendToNote(ctx, pathTarget, input.content, input.contentType);
|
|
110
|
+
const currentSizeInBytes = await svc.getSize(ctx, pathTarget);
|
|
111
|
+
return {
|
|
112
|
+
path,
|
|
113
|
+
sectionTargeted: false,
|
|
114
|
+
created: previousSizeInBytes === null,
|
|
115
|
+
previousSizeInBytes: previousSizeInBytes ?? 0,
|
|
116
|
+
currentSizeInBytes,
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
format: (result) => {
|
|
120
|
+
const action = result.created ? 'Created' : 'Appended to';
|
|
121
|
+
const lines = [`**${action} ${result.path}**`];
|
|
122
|
+
if (result.created) {
|
|
123
|
+
lines.push('*Note:* this file did not exist before — your content is now the entire file. If you expected to add to existing content, double-check the path.');
|
|
124
|
+
}
|
|
125
|
+
lines.push(`*Size:* ${result.previousSizeInBytes} → ${result.currentSizeInBytes} bytes`);
|
|
126
|
+
lines.push(`*Created:* ${result.created}`);
|
|
127
|
+
lines.push(`*Section targeted:* ${result.sectionTargeted}`);
|
|
128
|
+
return [{ type: 'text', text: lines.join('\n') }];
|
|
86
129
|
},
|
|
87
|
-
format: (result) => [
|
|
88
|
-
{
|
|
89
|
-
type: 'text',
|
|
90
|
-
text: [
|
|
91
|
-
`**Appended to ${result.path}**`,
|
|
92
|
-
`*Section targeted:* ${result.sectionTargeted}`,
|
|
93
|
-
].join('\n'),
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
130
|
});
|
|
97
131
|
//# sourceMappingURL=obsidian-append-to-note.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-append-to-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"obsidian-append-to-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,WAAW,EACT,qoBAAqoB;IACvoB,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;QACxF,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,kGAAkG,CACnG;QACD,WAAW,EAAE,iBAAiB;QAC9B,qBAAqB,EAAE,CAAC;aACrB,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CACP,qIAAqI,CACtI;KACJ,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACtE,eAAe,EAAE,CAAC;aACf,OAAO,EAAE;aACT,QAAQ,CACP,gHAAgH,CACjH;QACH,OAAO,EAAE,CAAC;aACP,OAAO,EAAE;aACT,QAAQ,CACP,gNAAgN,CACjN;QACH,mBAAmB,EAAE,CAAC;aACnB,MAAM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C;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC;QAC1D,MAAM,KAAK,GAAG,CAAC,KAAK,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CACR,kJAAkJ,CACnJ,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,mBAAmB,MAAM,MAAM,CAAC,kBAAkB,QAAQ,CAAC,CAAC;QACzF,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,uBAAuB,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;QAC5D,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -26,6 +26,8 @@ export declare const obsidianDeleteNote: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
26
26
|
}, z.core.$strip>, z.ZodObject<{
|
|
27
27
|
path: z.ZodString;
|
|
28
28
|
deleted: z.ZodBoolean;
|
|
29
|
+
previousSizeInBytes: z.ZodNumber;
|
|
30
|
+
currentSizeInBytes: z.ZodNumber;
|
|
29
31
|
}, z.core.$strip>, readonly [{
|
|
30
32
|
readonly reason: "path_forbidden";
|
|
31
33
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-delete-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"obsidian-delete-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqG7B,CAAC"}
|
|
@@ -17,6 +17,12 @@ export const obsidianDeleteNote = tool('obsidian_delete_note', {
|
|
|
17
17
|
output: z.object({
|
|
18
18
|
path: z.string().describe('Resolved vault-relative path of the deleted note.'),
|
|
19
19
|
deleted: z.boolean().describe('True when the file was removed.'),
|
|
20
|
+
previousSizeInBytes: z
|
|
21
|
+
.number()
|
|
22
|
+
.describe('Byte size of the note immediately before deletion. The destructive blast radius — useful for confirming the agent destroyed what it expected.'),
|
|
23
|
+
currentSizeInBytes: z
|
|
24
|
+
.number()
|
|
25
|
+
.describe('Always 0 after a successful delete — the file no longer exists.'),
|
|
20
26
|
}),
|
|
21
27
|
auth: ['tool:obsidian_delete_note:write'],
|
|
22
28
|
errors: [
|
|
@@ -59,10 +65,16 @@ export const obsidianDeleteNote = tool('obsidian_delete_note', {
|
|
|
59
65
|
],
|
|
60
66
|
async handler(input, ctx) {
|
|
61
67
|
const svc = getObsidianService();
|
|
62
|
-
const
|
|
63
|
-
const
|
|
68
|
+
const path = await svc.resolvePath(ctx, input.target);
|
|
69
|
+
const pathTarget = { type: 'path', path };
|
|
70
|
+
/**
|
|
71
|
+
* Probe size before showing the elicitation prompt so the user sees how
|
|
72
|
+
* much they're about to destroy. Throws `note_missing` if the file is
|
|
73
|
+
* already gone — preempts a confusing post-elicit DELETE 404.
|
|
74
|
+
*/
|
|
75
|
+
const previousSizeInBytes = await svc.getSize(ctx, pathTarget);
|
|
64
76
|
if (ctx.elicit) {
|
|
65
|
-
const confirmed = await ctx.elicit(`Permanently delete '${path}'? This cannot be undone via the API; recovery would require Obsidian's local trash.`, z.object({
|
|
77
|
+
const confirmed = await ctx.elicit(`Permanently delete '${path}' (${previousSizeInBytes} bytes)? This cannot be undone via the API; recovery would require Obsidian's local trash.`, z.object({
|
|
66
78
|
confirm: z.boolean().describe('Set to true to delete the note. Any other value cancels.'),
|
|
67
79
|
}));
|
|
68
80
|
if (confirmed.action !== 'accept' || confirmed.content?.confirm !== true) {
|
|
@@ -72,13 +84,13 @@ export const obsidianDeleteNote = tool('obsidian_delete_note', {
|
|
|
72
84
|
});
|
|
73
85
|
}
|
|
74
86
|
}
|
|
75
|
-
await svc.deleteNote(ctx,
|
|
76
|
-
return { path, deleted: true };
|
|
87
|
+
await svc.deleteNote(ctx, pathTarget);
|
|
88
|
+
return { path, deleted: true, previousSizeInBytes, currentSizeInBytes: 0 };
|
|
77
89
|
},
|
|
78
90
|
format: (result) => [
|
|
79
91
|
{
|
|
80
92
|
type: 'text',
|
|
81
|
-
text: `**Deleted ${result.path}** (
|
|
93
|
+
text: `**Deleted ${result.path}** (size: ${result.previousSizeInBytes} → ${result.currentSizeInBytes} bytes)`,
|
|
82
94
|
},
|
|
83
95
|
],
|
|
84
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-delete-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE;IAC7D,WAAW,EACT,iNAAiN;IACnN,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KACvD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;QAC9E,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"obsidian-delete-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC,sBAAsB,EAAE;IAC7D,WAAW,EACT,iNAAiN;IACnN,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;KACvD,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;QAC9E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
|
key: z.ZodString;
|
|
44
44
|
frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
45
|
+
previousSizeInBytes: z.ZodNumber;
|
|
46
|
+
currentSizeInBytes: z.ZodNumber;
|
|
45
47
|
}, z.core.$strip>, z.ZodObject<{
|
|
46
48
|
operation: z.ZodLiteral<"delete">;
|
|
47
49
|
path: z.ZodString;
|
|
48
50
|
key: z.ZodString;
|
|
49
51
|
frontmatter: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
52
|
+
previousSizeInBytes: z.ZodNumber;
|
|
53
|
+
currentSizeInBytes: z.ZodNumber;
|
|
50
54
|
}, z.core.$strip>], "operation">;
|
|
51
55
|
}, z.core.$strip>, readonly [{
|
|
52
56
|
readonly reason: "path_forbidden";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-manage-frontmatter.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"obsidian-manage-frontmatter.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkNpC,CAAC"}
|