obsidian-mcp-server 3.2.10 → 3.2.11
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/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/changelog/3.2.x/3.2.11.md +29 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +5 -0
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts +5 -0
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js +6 -0
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +103 -6
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/index.js +11 -4
- package/dist/mcp-server/tools/definitions/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts +10 -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 +12 -0
- 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 +10 -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 +12 -0
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts +10 -0
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +12 -0
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts +10 -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 +12 -0
- 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 +10 -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 +12 -0
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts +18 -2
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +49 -26
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts +10 -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 +12 -0
- 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 +10 -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 +12 -0
- 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 +10 -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 +12 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/dist/services/obsidian/obsidian-service.d.ts +11 -0
- package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
- package/dist/services/obsidian/obsidian-service.js +64 -2
- package/dist/services/obsidian/obsidian-service.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** obsidian-mcp-server
|
|
4
|
-
**Version:** 3.2.
|
|
4
|
+
**Version:** 3.2.11
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** obsidian-mcp-server
|
|
4
|
-
**Version:** 3.2.
|
|
4
|
+
**Version:** 3.2.11
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/obsidian-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/obsidian-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "obsidian_open_in_ui can no longer create a file under OBSIDIAN_READ_ONLY or outside OBSIDIAN_WRITE_PATHS, and a path naming a folder is rejected as path_is_directory instead of being read back as note content or recursively deleted"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 3.2.11 — 2026-08-02
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`path_is_directory` and `path_traversal` error contracts** ([#74](https://github.com/cyanheads/obsidian-mcp-server/issues/74)) — both declared on all nine path-accepting tools (`obsidian_get_note`, `obsidian_write_note`, `obsidian_append_to_note`, `obsidian_patch_note`, `obsidian_replace_in_note`, `obsidian_manage_frontmatter`, `obsidian_manage_tags`, `obsidian_delete_note`, `obsidian_open_in_ui`), plus `path_is_directory` on the `obsidian://vault/{+path}` resource, so both conditions carry a `data.reason` and a recovery hint.
|
|
12
|
+
- **`ObsidianService.openInUi` `createIfMissing` option** — selects `PathPolicy.assertWritable` over `assertReadable` for the branch where Obsidian would materialize the file.
|
|
13
|
+
|
|
14
|
+
## Changed
|
|
15
|
+
|
|
16
|
+
- **`obsidian_open_in_ui` runs the existence probe on both `failIfMissing` branches.** The `failIfMissing: false` path no longer skips it, so that path also gets the case-insensitive fallback the default path had — opening `readme.md` against a vault holding `README.md` resolves to the existing file instead of creating a second one on a case-sensitive filesystem.
|
|
17
|
+
- **`obsidian_open_in_ui` annotations** are now `openWorldHint: true`, `destructiveHint: false`, `idempotentHint: true`. `readOnlyHint` stays off — the tool can create a file where write access permits it — and with it absent, `destructiveHint` previously defaulted to true for a tool that destroys nothing.
|
|
18
|
+
- **`encodeVaultPath`** writes its `path_traversal` recovery hint at the throw site; as a free function with no `ctx`, it can't resolve one from the calling tool's contract.
|
|
19
|
+
- **Server instructions** under `OBSIDIAN_READ_ONLY=true` state that `obsidian_open_in_ui` still opens existing notes but rejects an open against a missing path.
|
|
20
|
+
|
|
21
|
+
## Fixed
|
|
22
|
+
|
|
23
|
+
- **`createdIfMissing` reports what happened** ([#73](https://github.com/cyanheads/obsidian-mcp-server/issues/73)) — it was hard-coded `true` on the `failIfMissing: false` branch, so opening an existing note reported a creation that never occurred. It is now `false` when the probe found the file and `true` only when Obsidian materialized it on open.
|
|
24
|
+
- **Note reads reject a path that names a folder** ([#95](https://github.com/cyanheads/obsidian-mcp-server/issues/95)) — the Local REST API answers `GET /vault/<dir>` with `200` and a JSON listing for every `Accept` type, so `obsidian_get_note` returned the listing as note content under `format: "content"` and failed opaquely under `full`, `document-map`, and `section`. `ObsidianService` now runs `#assertNotDirectory` on the markdown, `note+json`, and `document-map` reads and on the `HEAD` behind `tryGetSize`, throwing `path_is_directory`. The discriminator is a bare `application/json` with no `Content-Disposition`, scoped to `/vault/` — a vault `.json` file is served with the filename header and still reads as a note.
|
|
25
|
+
|
|
26
|
+
## Security
|
|
27
|
+
|
|
28
|
+
- **`obsidian_open_in_ui` could create a file under `OBSIDIAN_READ_ONLY=true`** ([#99](https://github.com/cyanheads/obsidian-mcp-server/issues/99)) — the create happens inside Obsidian on open, so it passed through no write check, and `OBSIDIAN_WRITE_PATHS` did not constrain it either. The existence probe now separates an open from a create: a missing path calls `openInUi` with `createIfMissing: true`, which fails `assertWritable` as `path_forbidden` before any `POST /open/` is issued.
|
|
29
|
+
- **`obsidian_delete_note` against a folder path removed the folder and everything under it.** `HEAD /vault/<folder>` answers `200` with the listing's byte count, so the pre-delete size probe read a folder as an existing note and the upstream `DELETE` recursed, reporting success with `previousSizeInBytes` set to the listing's size. The probe now stops at `path_is_directory` and issues no `DELETE`.
|
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ function buildInstructions() {
|
|
|
38
38
|
'Use the `obsidian_*` tools to access the Obsidian vault via the Local REST API plugin: search, read, write, and patch notes, including targeted edits to headings, blocks, and YAML frontmatter. Notes are addressed by vault-relative path including the file extension (e.g. `Folder/Note.md`); tags support hierarchical `parent/child` notation, and counts roll up to parents.',
|
|
39
39
|
];
|
|
40
40
|
if (config.readOnly) {
|
|
41
|
-
sections.push('Read-only mode is active (OBSIDIAN_READ_ONLY=true): every write tool rejects every path with `path_forbidden` / `read_only_mode`.');
|
|
41
|
+
sections.push('Read-only mode is active (OBSIDIAN_READ_ONLY=true): every write tool rejects every path with `path_forbidden` / `read_only_mode`. `obsidian_open_in_ui` still opens notes that exist, but rejects an open against a missing path — Obsidian would create the file.');
|
|
42
42
|
}
|
|
43
43
|
else if (!policy.isUnrestricted) {
|
|
44
44
|
const { readPaths, writePaths } = policy.describe();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;AACjC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAEtC;;;;;GAKG;AACH,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AACtC,MAAM,mBAAmB,GAAG,MAAM,QAAQ,CAAC,eAAe,EA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C;IACrC,QAAQ,CAAC,MAAM,CAAC,OAAO,CACrB,uHAAuH,EACvH,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -24,6 +24,11 @@ export declare const allResourceDefinitions: (import("@cyanheads/mcp-ts-core").R
|
|
|
24
24
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
25
25
|
readonly when: "The vault path does not resolve to an existing note.";
|
|
26
26
|
readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
|
|
27
|
+
}, {
|
|
28
|
+
readonly reason: "path_is_directory";
|
|
29
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
30
|
+
readonly when: "The requested path names a folder rather than a note file.";
|
|
31
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then request the URI of one of the files it returns.";
|
|
27
32
|
}]> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
28
33
|
tags: import("zod").ZodArray<import("zod").ZodObject<{
|
|
29
34
|
name: import("zod").ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAAoD,CAAC"}
|
|
@@ -28,5 +28,10 @@ export declare const obsidianVaultNote: import("@cyanheads/mcp-ts-core").Resourc
|
|
|
28
28
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
29
29
|
readonly when: "The vault path does not resolve to an existing note.";
|
|
30
30
|
readonly recovery: "Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.";
|
|
31
|
+
}, {
|
|
32
|
+
readonly reason: "path_is_directory";
|
|
33
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
34
|
+
readonly when: "The requested path names a folder rather than a note file.";
|
|
35
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then request the URI of one of the files it returns.";
|
|
31
36
|
}]>;
|
|
32
37
|
//# sourceMappingURL=obsidian-vault-note.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-vault-note.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"obsidian-vault-note.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuD5B,CAAC"}
|
|
@@ -43,6 +43,12 @@ export const obsidianVaultNote = resource('obsidian://vault/{+path}', {
|
|
|
43
43
|
when: 'The vault path does not resolve to an existing note.',
|
|
44
44
|
recovery: 'Verify the path with obsidian_list_notes or use obsidian_search_notes to locate the note.',
|
|
45
45
|
},
|
|
46
|
+
{
|
|
47
|
+
reason: 'path_is_directory',
|
|
48
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
49
|
+
when: 'The requested path names a folder rather than a note file.',
|
|
50
|
+
recovery: 'Call obsidian_list_notes with this path to list the folder, then request the URI of one of the files it returns.',
|
|
51
|
+
},
|
|
46
52
|
],
|
|
47
53
|
async handler(params, ctx) {
|
|
48
54
|
const svc = getObsidianService();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-vault-note.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,0BAA0B,EAAE;IACpE,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,yJAAyJ;IAC3J,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uDAAuD,CAAC;KAC1F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QAC7D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAClD,WAAW,EAAE,CAAC;aACX,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;aAC/B,QAAQ,CACP,4FAA4F,CAC7F;QACH,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;QACnF,IAAI,EAAE,CAAC;aACJ,MAAM,CAAC;YACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;YAC3D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;YAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;SACjD,CAAC;aACD,QAAQ,CAAC,gBAAgB,CAAC;KAC9B,CAAC;IACF,IAAI,EAAE,CAAC,mCAAmC,CAAC;IAC3C,MAAM,EAAE;QACN;YACE,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,gBAAgB,CAAC,SAAS;YAChC,IAAI,EAAE,oHAAoH;YAC1H,QAAQ,EACN,sFAAsF;SACzF;QACD;YACE,MAAM,EAAE,cAAc;YACtB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,sDAAsD;YAC5D,QAAQ,EACN,2FAA2F;SAC9F;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"obsidian-vault-note.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/obsidian-vault-note.resource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,iBAAiB,GAA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AAM,EAAE,cAAc;YACtB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,sDAAsD;YAC5D,QAAQ,EACN,2FAA2F;SAC9F;QACD;YACE,MAAM,EAAE,mBAAmB;YAC3B,IAAI,EAAE,gBAAgB,CAAC,eAAe;YACtC,IAAI,EAAE,4DAA4D;YAClE,QAAQ,EACN,kHAAkH;SACrH;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,10 +11,17 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { buildSearchNotesTool } from './obsidian-search-notes.tool.js';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Tools that don't depend on runtime probes — always registered, even with
|
|
15
|
+
* `OBSIDIAN_READ_ONLY=true`. `obsidian_search_notes` is constructed separately
|
|
16
|
+
* in the entry point via `buildSearchNotesTool` so its mode enum can reflect
|
|
17
|
+
* Omnisearch reachability.
|
|
18
|
+
*
|
|
19
|
+
* `obsidian_open_in_ui` stays here rather than in the write bucket so that
|
|
20
|
+
* opening a note that already exists keeps working on a read-only vault, which
|
|
21
|
+
* is both useful and side-effect-free. Its one create-capable branch — an open
|
|
22
|
+
* against a missing path with `failIfMissing: false`, which Obsidian would
|
|
23
|
+
* materialize — is gated as a write inside `ObsidianService.openInUi`, so
|
|
24
|
+
* read-only mode and `OBSIDIAN_WRITE_PATHS` still bind it.
|
|
18
25
|
*/
|
|
19
26
|
export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
20
27
|
format: import("zod").ZodEnum<{
|
|
@@ -131,6 +138,16 @@ export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
131
138
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
132
139
|
readonly when: "`format` was `\"section\"` and the named heading, block reference, or frontmatter field does not exist in the resolved note.";
|
|
133
140
|
readonly recovery: "Call obsidian_get_note with format \"document-map\" to list available headings, blocks, and frontmatter fields, then retry with one of those locators.";
|
|
141
|
+
}, {
|
|
142
|
+
readonly reason: "path_is_directory";
|
|
143
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
144
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
145
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
146
|
+
}, {
|
|
147
|
+
readonly reason: "path_traversal";
|
|
148
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
149
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
150
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
134
151
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
135
152
|
path: import("zod").ZodOptional<import("zod").ZodString>;
|
|
136
153
|
extension: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -216,8 +233,8 @@ export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
216
233
|
}, import("zod/v4/core").$strip>, readonly [{
|
|
217
234
|
readonly reason: "path_forbidden";
|
|
218
235
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Forbidden;
|
|
219
|
-
readonly when: "The
|
|
220
|
-
readonly recovery: "
|
|
236
|
+
readonly when: "The path is outside OBSIDIAN_READ_PATHS, or — when the file does not exist and `failIfMissing: false` would have Obsidian create it — outside OBSIDIAN_WRITE_PATHS or blocked by OBSIDIAN_READ_ONLY=true.";
|
|
237
|
+
readonly recovery: "Open a path inside the configured scope. The error data echoes the active scope and whether read or write access was the one denied.";
|
|
221
238
|
}, {
|
|
222
239
|
readonly reason: "note_missing";
|
|
223
240
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
@@ -228,6 +245,16 @@ export declare const readToolDefinitions: (import("@cyanheads/mcp-ts-core").Tool
|
|
|
228
245
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
|
|
229
246
|
readonly when: "The parent directory contains multiple files whose names differ only in case (case-sensitive filesystems only).";
|
|
230
247
|
readonly recovery: "Retry with one of the exact paths listed in `matches` on the error data.";
|
|
248
|
+
}, {
|
|
249
|
+
readonly reason: "path_is_directory";
|
|
250
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
251
|
+
readonly when: "The supplied path names a folder rather than a file.";
|
|
252
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then open one of the files it returns.";
|
|
253
|
+
}, {
|
|
254
|
+
readonly reason: "path_traversal";
|
|
255
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
256
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
257
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
231
258
|
}], undefined>)[];
|
|
232
259
|
/** Write tools — wrapped with `disabledTool()` when `OBSIDIAN_READ_ONLY=true`. */
|
|
233
260
|
export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
@@ -327,6 +354,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
327
354
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
328
355
|
readonly when: "The supplied content already appears at the target — the patch was rejected to keep retries idempotent (the default).";
|
|
329
356
|
readonly recovery: "Pass `patchOptions.applyIfContentPreexists: true` to force-apply over preexisting content, or change the content to something not already present.";
|
|
357
|
+
}, {
|
|
358
|
+
readonly reason: "path_is_directory";
|
|
359
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
360
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
361
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
362
|
+
}, {
|
|
363
|
+
readonly reason: "path_traversal";
|
|
364
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
365
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
366
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
330
367
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
331
368
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
332
369
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -405,6 +442,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
405
442
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.Conflict;
|
|
406
443
|
readonly when: "A bare heading leaf name matches more than one heading in the note, so the replacement target is undetermined.";
|
|
407
444
|
readonly recovery: "Retry with one of the full Parent::Child heading paths listed in `candidates` on the error data.";
|
|
445
|
+
}, {
|
|
446
|
+
readonly reason: "path_is_directory";
|
|
447
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
448
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
449
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
450
|
+
}, {
|
|
451
|
+
readonly reason: "path_traversal";
|
|
452
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
453
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
454
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
408
455
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
409
456
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
410
457
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -483,6 +530,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
483
530
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
484
531
|
readonly when: "Section append where the supplied content already appears at the target — rejected to keep retries idempotent (the default for the section path).";
|
|
485
532
|
readonly recovery: "Change the content to something not already present at the target, or use obsidian_patch_note with `patchOptions.applyIfContentPreexists: true` if a duplicate is intended.";
|
|
533
|
+
}, {
|
|
534
|
+
readonly reason: "path_is_directory";
|
|
535
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
536
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
537
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
538
|
+
}, {
|
|
539
|
+
readonly reason: "path_traversal";
|
|
540
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
541
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
542
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
486
543
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
487
544
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
488
545
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -553,6 +610,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
553
610
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
554
611
|
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
555
612
|
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
613
|
+
}, {
|
|
614
|
+
readonly reason: "path_is_directory";
|
|
615
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
616
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
617
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
618
|
+
}, {
|
|
619
|
+
readonly reason: "path_traversal";
|
|
620
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
621
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
622
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
556
623
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
557
624
|
operation: import("zod").ZodEnum<{
|
|
558
625
|
delete: "delete";
|
|
@@ -629,6 +696,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
629
696
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
630
697
|
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
631
698
|
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
699
|
+
}, {
|
|
700
|
+
readonly reason: "path_is_directory";
|
|
701
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
702
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
703
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
704
|
+
}, {
|
|
705
|
+
readonly reason: "path_traversal";
|
|
706
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
707
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
708
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
632
709
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
633
710
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
634
711
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -713,6 +790,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
713
790
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
714
791
|
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
715
792
|
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
793
|
+
}, {
|
|
794
|
+
readonly reason: "path_is_directory";
|
|
795
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
796
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
797
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
798
|
+
}, {
|
|
799
|
+
readonly reason: "path_traversal";
|
|
800
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
801
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
802
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
716
803
|
}], undefined> | import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
717
804
|
target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
718
805
|
type: import("zod").ZodLiteral<"path">;
|
|
@@ -765,6 +852,16 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
|
|
|
765
852
|
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
766
853
|
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
767
854
|
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
855
|
+
}, {
|
|
856
|
+
readonly reason: "path_is_directory";
|
|
857
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
858
|
+
readonly when: "The supplied path names a folder rather than a note file. Deleting a folder is not offered — the upstream removes it and everything inside it in one unrecoverable step.";
|
|
859
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then delete files one at a time by their full paths.";
|
|
860
|
+
}, {
|
|
861
|
+
readonly reason: "path_traversal";
|
|
862
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
|
|
863
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
864
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
768
865
|
}], undefined>)[];
|
|
769
866
|
/** Command-palette tools — opt-in via `OBSIDIAN_ENABLE_COMMANDS=true`; suppressed by `OBSIDIAN_READ_ONLY=true`. */
|
|
770
867
|
export declare const commandToolDefinitions: (import("@cyanheads/mcp-ts-core").ToolDefinition<import("zod").ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK/B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQhC,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiD,CAAC"}
|
|
@@ -24,10 +24,17 @@ import { obsidianReplaceInNote } from './obsidian-replace-in-note.tool.js';
|
|
|
24
24
|
import { obsidianWriteNote } from './obsidian-write-note.tool.js';
|
|
25
25
|
export { buildSearchNotesTool } from './obsidian-search-notes.tool.js';
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* Tools that don't depend on runtime probes — always registered, even with
|
|
28
|
+
* `OBSIDIAN_READ_ONLY=true`. `obsidian_search_notes` is constructed separately
|
|
29
|
+
* in the entry point via `buildSearchNotesTool` so its mode enum can reflect
|
|
30
|
+
* Omnisearch reachability.
|
|
31
|
+
*
|
|
32
|
+
* `obsidian_open_in_ui` stays here rather than in the write bucket so that
|
|
33
|
+
* opening a note that already exists keeps working on a read-only vault, which
|
|
34
|
+
* is both useful and side-effect-free. Its one create-capable branch — an open
|
|
35
|
+
* against a missing path with `failIfMissing: false`, which Obsidian would
|
|
36
|
+
* materialize — is gated as a write inside `ObsidianService.openInUi`, so
|
|
37
|
+
* read-only mode and `OBSIDIAN_WRITE_PATHS` still bind it.
|
|
31
38
|
*/
|
|
32
39
|
export const readToolDefinitions = [
|
|
33
40
|
obsidianGetNote,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;CACjB,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,qBAAqB;IACrB,yBAAyB;IACzB,kBAAkB;IAClB,kBAAkB;CACnB,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC"}
|
|
@@ -86,5 +86,15 @@ export declare const obsidianAppendToNote: import("@cyanheads/mcp-ts-core").Tool
|
|
|
86
86
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
87
87
|
readonly when: "Section append where the supplied content already appears at the target — rejected to keep retries idempotent (the default for the section path).";
|
|
88
88
|
readonly recovery: "Change the content to something not already present at the target, or use obsidian_patch_note with `patchOptions.applyIfContentPreexists: true` if a duplicate is intended.";
|
|
89
|
+
}, {
|
|
90
|
+
readonly reason: "path_is_directory";
|
|
91
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
92
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
93
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
94
|
+
}, {
|
|
95
|
+
readonly reason: "path_traversal";
|
|
96
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
97
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
98
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
89
99
|
}], undefined>;
|
|
90
100
|
//# sourceMappingURL=obsidian-append-to-note.tool.d.ts.map
|
|
@@ -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;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,oBAAoB
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiL/B,CAAC"}
|
|
@@ -92,6 +92,18 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
92
92
|
when: 'Section append where the supplied content already appears at the target — rejected to keep retries idempotent (the default for the section path).',
|
|
93
93
|
recovery: 'Change the content to something not already present at the target, or use obsidian_patch_note with `patchOptions.applyIfContentPreexists: true` if a duplicate is intended.',
|
|
94
94
|
},
|
|
95
|
+
{
|
|
96
|
+
reason: 'path_is_directory',
|
|
97
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
98
|
+
when: 'The supplied path names a folder rather than a note file.',
|
|
99
|
+
recovery: 'Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
reason: 'path_traversal',
|
|
103
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
104
|
+
when: 'The path contains a `.` or `..` segment, which is rejected to prevent vault escape.',
|
|
105
|
+
recovery: 'Supply a vault-relative path with no `.` or `..` segments, e.g. "Projects/Note.md". Use obsidian_list_notes to browse the vault.',
|
|
106
|
+
},
|
|
95
107
|
],
|
|
96
108
|
async handler(input, ctx) {
|
|
97
109
|
const svc = getObsidianService();
|
|
@@ -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;;;;;;;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,+xBAA+xB;IACjyB,WAAW,EAAE,E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,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,CACR,uBAAuB,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3G,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
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,+xBAA+xB;IACjyB,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE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I;YACrC,mBAAmB,EAAE,mBAAmB,IAAI,CAAC;YAC7C,kBAAkB;SACnB,CAAC;IACJ,CAAC;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,CACR,uBAAuB,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAC3G,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -58,5 +58,15 @@ export declare const obsidianDeleteNote: import("@cyanheads/mcp-ts-core").ToolDe
|
|
|
58
58
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
59
59
|
readonly when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.";
|
|
60
60
|
readonly recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.";
|
|
61
|
+
}, {
|
|
62
|
+
readonly reason: "path_is_directory";
|
|
63
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
64
|
+
readonly when: "The supplied path names a folder rather than a note file. Deleting a folder is not offered — the upstream removes it and everything inside it in one unrecoverable step.";
|
|
65
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then delete files one at a time by their full paths.";
|
|
66
|
+
}, {
|
|
67
|
+
readonly reason: "path_traversal";
|
|
68
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
69
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
70
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
61
71
|
}], undefined>;
|
|
62
72
|
//# sourceMappingURL=obsidian-delete-note.tool.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmH7B,CAAC"}
|
|
@@ -62,6 +62,18 @@ export const obsidianDeleteNote = tool('obsidian_delete_note', {
|
|
|
62
62
|
when: "Target was `periodic` but the requested period is not enabled in Obsidian's Periodic Notes plugin settings.",
|
|
63
63
|
recovery: "Pass an explicit path target — the requested period is disabled in the operator's Periodic Notes plugin.",
|
|
64
64
|
},
|
|
65
|
+
{
|
|
66
|
+
reason: 'path_is_directory',
|
|
67
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
68
|
+
when: 'The supplied path names a folder rather than a note file. Deleting a folder is not offered — the upstream removes it and everything inside it in one unrecoverable step.',
|
|
69
|
+
recovery: 'Call obsidian_list_notes with this path to list the folder, then delete files one at a time by their full paths.',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
reason: 'path_traversal',
|
|
73
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
74
|
+
when: 'The path contains a `.` or `..` segment, which is rejected to prevent vault escape.',
|
|
75
|
+
recovery: 'Supply a vault-relative path with no `.` or `..` segments, e.g. "Projects/Note.md". Use obsidian_list_notes to browse the vault.',
|
|
76
|
+
},
|
|
65
77
|
],
|
|
66
78
|
async handler(input, ctx) {
|
|
67
79
|
const svc = getObsidianService();
|
|
@@ -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,CAA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F;CACF,CAAC,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,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;QAChE,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,QAAQ,CACP,+IAA+I,CAChJ;QACH,kBAAkB,EAAE,CAAC;aAClB,MAAM,EAAE;aACR,QAAQ,CAAC,iEAAiE,CAAC;KAC/E,CAAC;IACF,IAAI,EAAE,CAAC,iCAAiC,CAAC;IACzC,MAAM,EAAE;QACN;YACE,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,gBAAgB,CAAC,SAAS;YAChC,IAAI,EAAE,gGAAgG;YACtG,QAAQ,EACN,uFAAuF;SAC1F;QACD;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,cAAc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AAC,MAAM,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,CAChC,uBAAuB,IAAI,MAAM,mBAAmB,4FAA4F,EAChJ,CAAC,CAAC,MAAM,CAAC;gBACP,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;aAC1F,CAAC,CACH,CAAC;YACF,IAAI,SAAS,CAAC,MAAM,KAAK,QAAQ,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;gBACzE,MAAM,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,6BAA6B,EAAE;oBACzD,IAAI;oBACJ,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC;iBAChC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,aAAa,MAAM,CAAC,IAAI,aAAa,MAAM,CAAC,mBAAmB,MAAM,MAAM,CAAC,kBAAkB,SAAS;SAC9G;KACF;CACF,CAAC,CAAC"}
|
|
@@ -120,5 +120,15 @@ export declare const obsidianGetNote: import("@cyanheads/mcp-ts-core").ToolDefin
|
|
|
120
120
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
121
121
|
readonly when: "`format` was `\"section\"` and the named heading, block reference, or frontmatter field does not exist in the resolved note.";
|
|
122
122
|
readonly recovery: "Call obsidian_get_note with format \"document-map\" to list available headings, blocks, and frontmatter fields, then retry with one of those locators.";
|
|
123
|
+
}, {
|
|
124
|
+
readonly reason: "path_is_directory";
|
|
125
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
126
|
+
readonly when: "The supplied path names a folder rather than a note file.";
|
|
127
|
+
readonly recovery: "Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.";
|
|
128
|
+
}, {
|
|
129
|
+
readonly reason: "path_traversal";
|
|
130
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
131
|
+
readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape.";
|
|
132
|
+
readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault.";
|
|
123
133
|
}], undefined>;
|
|
124
134
|
//# sourceMappingURL=obsidian-get-note.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-get-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-get-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAsB,MAAM,+BAA+B,CAAC;AAarF,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"obsidian-get-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-get-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAsB,MAAM,+BAA+B,CAAC;AAarF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmU1B,CAAC"}
|
|
@@ -138,6 +138,18 @@ export const obsidianGetNote = tool('obsidian_get_note', {
|
|
|
138
138
|
when: '`format` was `"section"` and the named heading, block reference, or frontmatter field does not exist in the resolved note.',
|
|
139
139
|
recovery: 'Call obsidian_get_note with format "document-map" to list available headings, blocks, and frontmatter fields, then retry with one of those locators.',
|
|
140
140
|
},
|
|
141
|
+
{
|
|
142
|
+
reason: 'path_is_directory',
|
|
143
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
144
|
+
when: 'The supplied path names a folder rather than a note file.',
|
|
145
|
+
recovery: 'Call obsidian_list_notes with this path to list the folder, then retry with the full path of one of the files it returns.',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
reason: 'path_traversal',
|
|
149
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
150
|
+
when: 'The path contains a `.` or `..` segment, which is rejected to prevent vault escape.',
|
|
151
|
+
recovery: 'Supply a vault-relative path with no `.` or `..` segments, e.g. "Projects/Note.md". Use obsidian_list_notes to browse the vault.',
|
|
152
|
+
},
|
|
141
153
|
],
|
|
142
154
|
async handler(input, ctx) {
|
|
143
155
|
const svc = getObsidianService();
|