obsidian-mcp-server 3.7.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +20 -15
- package/CLAUDE.md +20 -15
- package/README.md +31 -19
- package/changelog/3.8.x/3.8.0.md +38 -0
- package/changelog/3.9.x/3.9.0.md +43 -0
- package/changelog/template.md +10 -3
- package/dist/config/server-config.d.ts +1 -0
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +30 -19
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +27 -15
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +4 -3
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +23 -12
- package/dist/instructions.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +2 -2
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.d.ts +3 -2
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.js +6 -5
- package/dist/mcp-server/resources/definitions/obsidian-tags.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.d.ts +2 -2
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js +2 -2
- package/dist/mcp-server/resources/definitions/obsidian-vault-note.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts +15 -6
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js +24 -12
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +250 -230
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/index.js +6 -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 +8 -2
- 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 +10 -3
- 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 +7 -6
- 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 +7 -7
- 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 +2 -2
- 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 +8 -5
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts +6 -6
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js +8 -8
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts +4 -4
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +7 -7
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +3 -3
- 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 +8 -2
- 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 +10 -3
- 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 -2
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js +2 -2
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts +185 -35
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +145 -82
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts +8 -2
- 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 -5
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/dist/services/obsidian/jsonlogic-evaluator.d.ts +33 -8
- package/dist/services/obsidian/jsonlogic-evaluator.d.ts.map +1 -1
- package/dist/services/obsidian/jsonlogic-evaluator.js +171 -32
- package/dist/services/obsidian/jsonlogic-evaluator.js.map +1 -1
- package/dist/services/obsidian/jsonlogic-worker.d.ts +6 -5
- package/dist/services/obsidian/jsonlogic-worker.d.ts.map +1 -1
- package/dist/services/obsidian/jsonlogic-worker.js +7 -5
- package/dist/services/obsidian/jsonlogic-worker.js.map +1 -1
- package/dist/services/obsidian/obsidian-service.d.ts +90 -36
- package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
- package/dist/services/obsidian/obsidian-service.js +748 -248
- package/dist/services/obsidian/obsidian-service.js.map +1 -1
- package/dist/services/obsidian/patch-instruction.d.ts +4 -1
- package/dist/services/obsidian/patch-instruction.d.ts.map +1 -1
- package/dist/services/obsidian/patch-instruction.js +5 -2
- package/dist/services/obsidian/patch-instruction.js.map +1 -1
- package/dist/services/obsidian/path-policy.d.ts +67 -23
- package/dist/services/obsidian/path-policy.d.ts.map +1 -1
- package/dist/services/obsidian/path-policy.js +183 -80
- package/dist/services/obsidian/path-policy.js.map +1 -1
- package/dist/services/obsidian/section-extractor.d.ts +62 -1
- package/dist/services/obsidian/section-extractor.d.ts.map +1 -1
- package/dist/services/obsidian/section-extractor.js +387 -51
- package/dist/services/obsidian/section-extractor.js.map +1 -1
- package/dist/services/obsidian/simple-search.d.ts +62 -0
- package/dist/services/obsidian/simple-search.d.ts.map +1 -0
- package/dist/services/obsidian/simple-search.js +264 -0
- package/dist/services/obsidian/simple-search.js.map +1 -0
- package/manifest.json +12 -4
- package/package.json +9 -9
- package/server.json +23 -11
- package/skills/obsidian-guide/SKILL.md +61 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview obsidian_search_notes — text/jsonlogic/omnisearch search with
|
|
3
|
-
* MCP-spec cursor pagination. The `omnisearch` mode is
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* multi-token query's per-token spans) and additionally clip
|
|
7
|
-
* `maxMatchesPerHit` so a single match-heavy note can't blow the
|
|
8
|
-
* budget — clipped hits carry `truncated: true` and `totalMatches`.
|
|
3
|
+
* MCP-spec cursor pagination. The `omnisearch` mode is offered only with reads
|
|
4
|
+
* unscoped and the Omnisearch plugin's HTTP server answering at startup
|
|
5
|
+
* (`omnisearchAvailability`). Text-mode hits carry match locations (the
|
|
6
|
+
* service merges a multi-token query's per-token spans) and additionally clip
|
|
7
|
+
* per file via `maxMatchesPerHit` so a single match-heavy note can't blow the
|
|
8
|
+
* response budget — clipped hits carry `truncated: true` and `totalMatches`.
|
|
9
9
|
* @module mcp-server/tools/definitions/obsidian-search-notes.tool
|
|
10
10
|
*/
|
|
11
11
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
@@ -18,10 +18,25 @@ const MAX_PAGE_SIZE = 200;
|
|
|
18
18
|
const DEFAULT_MATCHES_PER_HIT = 10;
|
|
19
19
|
/** Omnisearch's hardwired upstream cap — pagination/limit params are ignored. */
|
|
20
20
|
const OMNISEARCH_UPSTREAM_CAP = 50;
|
|
21
|
+
/** Why an omnisearch result may be missing matches its 50-hit cap cut. */
|
|
22
|
+
const OMNISEARCH_TRUNCATIONS = {
|
|
23
|
+
cap_reached: `Omnisearch returned its ${OMNISEARCH_UPSTREAM_CAP}-hit cap, so more matches may exist. Narrow with \`path:\`, \`ext:\`, or more plain terms, which Omnisearch applies before the cap.`,
|
|
24
|
+
filtered_after_cap: `Omnisearch keeps its top ${OMNISEARCH_UPSTREAM_CAP} matches before it applies quoted terms and \`-exclusion\` terms, so matches past the cap were never checked. Narrow with \`path:\`, \`ext:\`, or more plain terms, which apply before the cap, or rerun without the quoted and excluded terms to see whether the cap was reached.`,
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Decide {@link OmnisearchAvailability} once, at startup. Under a read scope
|
|
28
|
+
* it is `withheld` with no request, the probe included; otherwise the probe
|
|
29
|
+
* decides.
|
|
30
|
+
*/
|
|
31
|
+
export async function omnisearchAvailability(svc) {
|
|
32
|
+
if (svc.policy.restrictsReads)
|
|
33
|
+
return 'withheld';
|
|
34
|
+
return (await svc.probeOmnisearch()) ? 'offered' : 'unreachable';
|
|
35
|
+
}
|
|
21
36
|
const CursorSchema = z
|
|
22
37
|
.string()
|
|
23
38
|
.optional()
|
|
24
|
-
.describe('Opaque cursor from a prior response. Omit for the first page. Page size is server-determined; do not assume a fixed value. Under OBSIDIAN_READ_PATHS, later `jsonlogic` pages come from the hit list the first page computed.');
|
|
39
|
+
.describe('Opaque cursor from a prior response. Omit for the first page. Page size is server-determined; do not assume a fixed value. Under OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, later `text` and `jsonlogic` pages come from the hit list the first page computed.');
|
|
25
40
|
const TextHitSchema = z
|
|
26
41
|
.object({
|
|
27
42
|
filename: z.string().describe('Vault-relative path of the matching note.'),
|
|
@@ -66,7 +81,9 @@ const OmnisearchHitSchema = z
|
|
|
66
81
|
.object({
|
|
67
82
|
filename: z.string().describe('Vault-relative path of the matching note.'),
|
|
68
83
|
basename: z.string().describe('Note basename without extension.'),
|
|
69
|
-
score: z
|
|
84
|
+
score: z
|
|
85
|
+
.number()
|
|
86
|
+
.describe("Omnisearch's BM25 relevance score; higher is more relevant. `0` marks a note Omnisearch added because it embeds an earlier hit, which need not contain the query words."),
|
|
70
87
|
foundWords: z
|
|
71
88
|
.array(z.string())
|
|
72
89
|
.describe('Query words found in the note. Populated even when no body match exists (e.g. basename-only match), so empty `matches` paired with non-empty `foundWords` is valid.'),
|
|
@@ -77,41 +94,42 @@ const OmnisearchHitSchema = z
|
|
|
77
94
|
offset: z.number().describe('Offset of the match within the note body.'),
|
|
78
95
|
})
|
|
79
96
|
.describe('A single match span in the note body.'))
|
|
80
|
-
.describe('Match positions within the note body.
|
|
97
|
+
.describe('Match positions within the note body. Omnisearch locates them only for the first 10 hits it returns, so every later hit has none, and an earlier hit has none when the query words occur only in its basename.'),
|
|
81
98
|
excerpt: z
|
|
82
99
|
.string()
|
|
83
|
-
.describe(
|
|
100
|
+
.describe("Text from the note around its first match in `matches`; a hit with empty `matches` gets the note's opening instead. HTML entities are decoded and `<br>` becomes `\\n`."),
|
|
84
101
|
})
|
|
85
102
|
.describe('An Omnisearch BM25-ranked hit.');
|
|
86
103
|
/**
|
|
87
104
|
* Build the `obsidian_search_notes` tool. The `omnisearch` mode is included
|
|
88
|
-
* in the input/output schemas only when `
|
|
89
|
-
* LLM never sees it as an option on a deployment where it
|
|
90
|
-
* requires a server restart.
|
|
105
|
+
* in the input/output schemas and the description only when `omnisearch` is
|
|
106
|
+
* `offered`, so the LLM never sees it as an option on a deployment where it
|
|
107
|
+
* can't run or is withheld. Re-probe requires a server restart.
|
|
91
108
|
*/
|
|
92
|
-
export function buildSearchNotesTool({
|
|
93
|
-
const
|
|
109
|
+
export function buildSearchNotesTool({ omnisearch }) {
|
|
110
|
+
const omnisearchOffered = omnisearch === 'offered';
|
|
111
|
+
const modeEnum = omnisearchOffered
|
|
94
112
|
? ['text', 'jsonlogic', 'omnisearch']
|
|
95
113
|
: ['text', 'jsonlogic'];
|
|
96
|
-
const description =
|
|
114
|
+
const description = omnisearchOffered
|
|
97
115
|
? 'Search the vault by text tokens, JSONLogic predicate, or BM25-ranked Omnisearch query. Pick the mode that matches the query shape — `omnisearch` is best for ranked relevance, typo tolerance, and PDF/OCR coverage (via the Text Extractor plugin). Results paginate via opaque cursors: omit `cursor` for the first page, then pass `nextCursor` from the prior response. Text-mode hits additionally clip per file at `maxMatchesPerHit` match locations.'
|
|
98
116
|
: 'Search the vault by text tokens or JSONLogic predicate. Pick the mode that matches the query shape. Results paginate via opaque cursors: omit `cursor` for the first page, then pass `nextCursor` from the prior response. Text-mode hits additionally clip per file at `maxMatchesPerHit` match locations.';
|
|
99
|
-
const textModeDescription = '`text` splits `query` on
|
|
100
|
-
const jsonlogicModeDescription = '`jsonlogic` evaluates a JSONLogic tree against each note, with `var` paths into `path`, `content`, `frontmatter.<key>`, `tags`, `stat.{ctime,mtime,size}`, and `links`, `backlinks`, and `unresolvedLinks` (on plugin versions that provide them; under OBSIDIAN_READ_PATHS,
|
|
117
|
+
const textModeDescription = '`text` splits `query` on spaces and requires every token, each matched case-insensitively as a substring of the filename or note body; a tab or line break stays part of its token. Quotes are literal characters, not a phrase operator. Each hit returns match locations with surrounding context windows; tokens that sit close together, such as the words of a phrase, share one location.';
|
|
118
|
+
const jsonlogicModeDescription = '`jsonlogic` evaluates a JSONLogic tree against each note, with `var` paths into `path`, `content`, `frontmatter.<key>`, `tags`, `stat.{ctime,mtime,size}`, and `links`, `backlinks`, and `unresolvedLinks` (on plugin versions that provide them; not under OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, where a tree that reads them is rejected), plus `glob` and `regexp` operators — both take their arguments as `[PATTERN, VALUE]`, so the pattern comes first and the `{"var": ...}` reference second.';
|
|
101
119
|
const inputSchema = z.object({
|
|
102
120
|
mode: z
|
|
103
121
|
.enum(modeEnum)
|
|
104
|
-
.describe(
|
|
105
|
-
? `Which search algorithm to run. ${textModeDescription} ${jsonlogicModeDescription} \`omnisearch\` runs a BM25-ranked query via the Omnisearch plugin — supports quoted phrases, \`-exclusion\`, \`path:\` / \`ext:\` filters, typo tolerance, and PDF/OCR (with Text Extractor)
|
|
122
|
+
.describe(omnisearchOffered
|
|
123
|
+
? `Which search algorithm to run. ${textModeDescription} ${jsonlogicModeDescription} \`omnisearch\` runs a BM25-ranked query via the Omnisearch plugin — supports quoted phrases, \`-exclusion\`, \`path:\` / \`ext:\` filters, typo tolerance, and PDF/OCR (with Text Extractor). Omnisearch keeps its top ${OMNISEARCH_UPSTREAM_CAP} matches, applying \`path:\` and \`ext:\` before that cap and quoted phrases and \`-exclusion\` after the cap (see \`truncated\`).`
|
|
106
124
|
: `Which search algorithm to run. ${textModeDescription} ${jsonlogicModeDescription}`),
|
|
107
125
|
query: z
|
|
108
126
|
.string()
|
|
109
127
|
.optional()
|
|
110
|
-
.describe('The query string. Required
|
|
128
|
+
.describe('The query string. Required in every mode but `jsonlogic`, which ignores it (use `logic` instead — this field must be a string, so passing a JSONLogic tree here is rejected). In `text` mode it is split on spaces and every token must appear; quotes stay part of the tokens, so a quoted phrase matches nothing unless the note contains the quote characters.'),
|
|
111
129
|
logic: z
|
|
112
130
|
.record(z.string(), z.unknown())
|
|
113
131
|
.optional()
|
|
114
|
-
.describe('JSONLogic tree. Required for `jsonlogic` mode
|
|
132
|
+
.describe('JSONLogic tree. Required for `jsonlogic` mode and ignored in every other (use `query` instead — this field must be an object, so passing a string here is rejected). `glob` and `regexp` take `[PATTERN, VALUE]` — pattern first: `{"glob": ["Projects/*.md", {"var": "path"}]}`. Backlinks ("what links here") have no dedicated tool; find them this way: `{"regexp": ["\\\\[\\\\[Target Note(\\\\\\\\?\\\\||#|\\\\]\\\\])", {"var": "content"}]}` finds every readable note whose body wikilinks or embeds `Target Note`, in plain, aliased (`|`, or the table-safe `\\|`), or section form. `obsidian_get_note` with `includeLinks: true` covers the outgoing direction.'),
|
|
115
133
|
contextLength: z
|
|
116
134
|
.number()
|
|
117
135
|
.int()
|
|
@@ -171,10 +189,14 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
171
189
|
.describe('Opaque cursor for the next page. Omitted on the last page (do not treat absent as null).'),
|
|
172
190
|
truncated: z
|
|
173
191
|
.boolean()
|
|
174
|
-
.describe(
|
|
192
|
+
.describe(`True whenever Omnisearch's ${OMNISEARCH_UPSTREAM_CAP}-hit cap may have cut matches that are not retrievable: when it returned ${OMNISEARCH_UPSTREAM_CAP} or more, and when the query holds quoted terms or \`-exclusion\` terms, which Omnisearch applies after its cap. Narrow with \`path:\`, \`ext:\`, or more plain terms, which Omnisearch applies before its cap.`),
|
|
193
|
+
truncatedReason: z
|
|
194
|
+
.enum(['cap_reached', 'filtered_after_cap'])
|
|
195
|
+
.optional()
|
|
196
|
+
.describe('Why `truncated` is true, present only then: `cap_reached` (Omnisearch returned its cap) or `filtered_after_cap` (quoted or `-exclusion` terms filtered after the cap).'),
|
|
175
197
|
})
|
|
176
198
|
.describe('Omnisearch BM25 results.');
|
|
177
|
-
const branches =
|
|
199
|
+
const branches = omnisearchOffered
|
|
178
200
|
? [textBranch, jsonlogicBranch, omnisearchBranch]
|
|
179
201
|
: [textBranch, jsonlogicBranch];
|
|
180
202
|
const outputSchema = z.object({
|
|
@@ -182,14 +204,25 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
182
204
|
.discriminatedUnion('mode', [...branches])
|
|
183
205
|
.describe('Mode-discriminated search payload.'),
|
|
184
206
|
});
|
|
207
|
+
/**
|
|
208
|
+
* Thrown by the service on the omnisearch path alone, so declared only where
|
|
209
|
+
* the mode is offered: `tools/list` renders every entry, and a withheld or
|
|
210
|
+
* unreachable mode leaves nothing that names Omnisearch.
|
|
211
|
+
*/
|
|
212
|
+
const omnisearchErrors = [
|
|
213
|
+
{
|
|
214
|
+
reason: 'omnisearch_unreachable',
|
|
215
|
+
thrownBy: 'service',
|
|
216
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
217
|
+
when: 'Omnisearch was reachable at startup but did not answer: it is unreachable (Obsidian quit, plugin disabled, or mobile session), answered with a non-2xx status, or took longer than OBSIDIAN_REQUEST_TIMEOUT_MS. One attempt, never retried.',
|
|
218
|
+
retryable: true,
|
|
219
|
+
recovery: 'Confirm Obsidian is running with the Omnisearch plugin enabled and retry, or narrow the query if it was slow. If Omnisearch stays down, restart Obsidian, then restart this MCP server so it re-probes the plugin URL.',
|
|
220
|
+
},
|
|
221
|
+
];
|
|
185
222
|
/**
|
|
186
223
|
* Declared inline as a `const` tuple so `tool()`'s `const TErrors` generic
|
|
187
224
|
* captures the literal reason strings — that's what gives the handler its
|
|
188
|
-
* typed `ctx.fail<'reason'>(...)`.
|
|
189
|
-
* declared unconditionally even when `omnisearchReachable` is false; the
|
|
190
|
-
* branch that throws it only runs in the omnisearch handler path (which
|
|
191
|
-
* only runs when reachable), so the entry is harmless when unused and
|
|
192
|
-
* keeps the contract shape stable across deployments.
|
|
225
|
+
* typed `ctx.fail<'reason'>(...)`.
|
|
193
226
|
*/
|
|
194
227
|
const errors = [
|
|
195
228
|
{
|
|
@@ -201,15 +234,17 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
201
234
|
{
|
|
202
235
|
reason: 'query_required',
|
|
203
236
|
code: JsonRpcErrorCode.ValidationError,
|
|
204
|
-
when: '`query` is missing
|
|
205
|
-
recovery:
|
|
237
|
+
when: '`query` is missing in a mode that requires it: every mode but `jsonlogic`.',
|
|
238
|
+
recovery: omnisearchOffered
|
|
239
|
+
? 'Pass `query` — space-separated tokens, all required, for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.'
|
|
240
|
+
: 'Pass `query` as space-separated tokens, all of which a note must contain.',
|
|
206
241
|
},
|
|
207
242
|
{
|
|
208
243
|
reason: 'context_length_too_large',
|
|
209
244
|
thrownBy: 'service',
|
|
210
245
|
code: JsonRpcErrorCode.ValidationError,
|
|
211
|
-
when:
|
|
212
|
-
recovery: '
|
|
246
|
+
when: "The matches would make a response longer than one can be, so the whole text search failed: the Local REST API runs out of string capacity serializing them, or, under OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, the readable notes' matches alone would pass the same ceiling. Each match costs its context window plus about 150 characters of offsets and framing.",
|
|
247
|
+
recovery: 'Narrow the query so fewer notes match, and drop very common tokens: every occurrence of each token in a matching note is a match costing about 150 characters beside its window, so a token like `the` can fail even at `contextLength` 0. Lowering `contextLength` helps only while the windows, about twice `contextLength` each, dominate that cost.',
|
|
213
248
|
},
|
|
214
249
|
{
|
|
215
250
|
reason: 'logic_required',
|
|
@@ -228,24 +263,31 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
228
263
|
reason: 'logic_too_costly',
|
|
229
264
|
thrownBy: 'service',
|
|
230
265
|
code: JsonRpcErrorCode.ValidationError,
|
|
231
|
-
when: "With OBSIDIAN_READ_PATHS set, the server evaluates the JSONLogic tree itself, and the tree passed a bound: nesting deeper than 1,000 levels, more than a work budget,
|
|
266
|
+
when: "With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the server evaluates the JSONLogic tree itself, and the tree passed a bound: nesting deeper than 1,000 levels, more than a work budget, more than 10 s of evaluation, or more than 45 s for the whole search, reading the readable notes included. One work budget is per note — the size of values built by `merge`, `cat`, `map`, and array literals while evaluating that note, up to the note's own size plus 10,000,000 units — and one is per search: 10,000,000 units across every note for returned results, where a result whose JSON is at most 1,024 characters is free and a larger one pays for what it holds beyond its own note.",
|
|
232
267
|
recovery: "Simplify the tree: nest fewer levels, avoid building arrays or strings many times a note's size with `merge`, `cat`, `map`, or `reduce`, return values drawn from the note rather than large built values or constants, and prefer a simpler `regexp` pattern.",
|
|
233
268
|
},
|
|
234
269
|
{
|
|
235
|
-
reason: '
|
|
270
|
+
reason: 'text_search_too_costly',
|
|
236
271
|
thrownBy: 'service',
|
|
237
|
-
code: JsonRpcErrorCode.
|
|
238
|
-
when: 'With OBSIDIAN_READ_PATHS set,
|
|
239
|
-
recovery: '
|
|
272
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
273
|
+
when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the server runs text mode itself, reading every readable note whose path or body holds each token, and reading and matching them took more than 45 s.',
|
|
274
|
+
recovery: 'Add rarer tokens, which every candidate note must contain, so fewer readable notes are read, or ask the operator to narrow OBSIDIAN_READ_PATHS or extend OBSIDIAN_DENY_PATHS.',
|
|
240
275
|
},
|
|
241
276
|
{
|
|
242
|
-
reason: '
|
|
277
|
+
reason: 'link_fields_unavailable',
|
|
243
278
|
thrownBy: 'service',
|
|
244
|
-
code: JsonRpcErrorCode.
|
|
245
|
-
when: '
|
|
246
|
-
|
|
247
|
-
|
|
279
|
+
code: JsonRpcErrorCode.ValidationError,
|
|
280
|
+
when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the JSONLogic tree names `links`, `backlinks`, or `unresolvedLinks` by a fixed `var`, `missing`, or `missing_some` key. Scoped searches leave these fields out, since Obsidian resolves each link across the whole vault, notes outside the scope included; a computed key reads them as null.',
|
|
281
|
+
recovery: 'Find backlinks by body text: `{"regexp": ["\\\\[\\\\[Target Note(\\\\\\\\?\\\\||#|\\\\]\\\\])", {"var": "content"}]}` matches every readable note that wikilinks or embeds `Target Note`. For a note\'s outgoing links, call `obsidian_get_note` with `includeLinks: true`.',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
reason: 'note_too_deep',
|
|
285
|
+
thrownBy: 'service',
|
|
286
|
+
code: JsonRpcErrorCode.SerializationError,
|
|
287
|
+
when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, a readable note holds data, usually a frontmatter value, nested deeper than the server can hand to its evaluator (about 3,500 levels under Node, more under Bun).',
|
|
288
|
+
recovery: 'Flatten the deeply nested value, usually a frontmatter field, in the note the message names, or ask the operator to leave that note out of OBSIDIAN_READ_PATHS or add it to OBSIDIAN_DENY_PATHS; no scoped jsonlogic search runs while it is readable.',
|
|
248
289
|
},
|
|
290
|
+
...(omnisearchOffered ? omnisearchErrors : []),
|
|
249
291
|
];
|
|
250
292
|
return tool('obsidian_search_notes', {
|
|
251
293
|
description,
|
|
@@ -258,7 +300,7 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
258
300
|
effectiveQuery: z
|
|
259
301
|
.string()
|
|
260
302
|
.optional()
|
|
261
|
-
.describe('The query string as submitted (
|
|
303
|
+
.describe('The query string as submitted (every mode but `jsonlogic`).'),
|
|
262
304
|
notice: z.string().optional().describe('Recovery guidance when the search returned no hits.'),
|
|
263
305
|
},
|
|
264
306
|
auth: ['tool:obsidian_search_notes:read'],
|
|
@@ -278,12 +320,15 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
278
320
|
});
|
|
279
321
|
}
|
|
280
322
|
ctx.enrich.echo(input.query);
|
|
281
|
-
const raw = await svc.searchText(ctx, input.query, input.contextLength);
|
|
282
323
|
const prefix = input.pathPrefix;
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
324
|
+
const searched = await svc.pageText(ctx, {
|
|
325
|
+
query: input.query,
|
|
326
|
+
contextLength: input.contextLength,
|
|
327
|
+
maxMatchesPerHit: input.maxMatchesPerHit,
|
|
328
|
+
pathPrefix: prefix,
|
|
329
|
+
}, ...cursorPage(input.cursor, ctx));
|
|
330
|
+
const allowed = policy.filterReadable(searched.hits);
|
|
331
|
+
const page = paginate(allowed, input.cursor, ctx, searched.walk);
|
|
287
332
|
if (page.hits.length === 0) {
|
|
288
333
|
ctx.enrich.notice(`No matches for ${inlineCode(input.query)}${prefix ? ` under prefix ${inlineCode(prefix)}` : ''}. Try broader terms, a different mode, or check that the path/filter is correct.`);
|
|
289
334
|
}
|
|
@@ -293,15 +338,7 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
293
338
|
if (!input.logic) {
|
|
294
339
|
throw ctx.fail('logic_required', '`logic` (JSONLogic tree) is required for jsonlogic mode.', { mode: input.mode });
|
|
295
340
|
}
|
|
296
|
-
|
|
297
|
-
* A scoped search's cursor names the walk its first page stored, so
|
|
298
|
-
* the later pages read that stored hit list instead of evaluating the
|
|
299
|
-
* tree again.
|
|
300
|
-
*/
|
|
301
|
-
const walk = input.cursor
|
|
302
|
-
? decodeCursor(input.cursor, requestContext(ctx)).walk
|
|
303
|
-
: undefined;
|
|
304
|
-
const searched = await svc.pageJsonLogic(ctx, input.logic, typeof walk === 'string' ? walk : undefined, DEFAULT_PAGE_SIZE);
|
|
341
|
+
const searched = await svc.pageJsonLogic(ctx, input.logic, ...cursorPage(input.cursor, ctx));
|
|
305
342
|
const allowed = policy.filterReadable(searched.hits);
|
|
306
343
|
const page = paginate(allowed, input.cursor, ctx, searched.walk);
|
|
307
344
|
if (page.hits.length === 0) {
|
|
@@ -309,7 +346,7 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
309
346
|
}
|
|
310
347
|
return { result: { mode: 'jsonlogic', ...page } };
|
|
311
348
|
}
|
|
312
|
-
// omnisearch — only
|
|
349
|
+
// omnisearch — in the schema only when the mode was offered at build time.
|
|
313
350
|
if (!input.query) {
|
|
314
351
|
throw ctx.fail('query_required', '`query` is required for omnisearch mode.', {
|
|
315
352
|
mode: input.mode,
|
|
@@ -317,12 +354,7 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
317
354
|
}
|
|
318
355
|
ctx.enrich.echo(input.query);
|
|
319
356
|
const raw = await svc.searchOmnisearch(ctx, input.query);
|
|
320
|
-
|
|
321
|
-
* Compute `truncated` against the raw upstream array, before path-policy
|
|
322
|
-
* filtering — a filtered-down set legitimately under 50 should not be
|
|
323
|
-
* reported as truncated.
|
|
324
|
-
*/
|
|
325
|
-
const truncated = raw.length >= OMNISEARCH_UPSTREAM_CAP;
|
|
357
|
+
const truncatedReason = omnisearchTruncation(input.query, raw.length);
|
|
326
358
|
const allowed = policy.filterReadable(raw);
|
|
327
359
|
const page = paginate(allowed, input.cursor, ctx);
|
|
328
360
|
if (page.hits.length === 0) {
|
|
@@ -332,7 +364,8 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
332
364
|
result: {
|
|
333
365
|
mode: 'omnisearch',
|
|
334
366
|
...page,
|
|
335
|
-
truncated,
|
|
367
|
+
truncated: truncatedReason !== undefined,
|
|
368
|
+
...(truncatedReason ? { truncatedReason } : {}),
|
|
336
369
|
},
|
|
337
370
|
};
|
|
338
371
|
},
|
|
@@ -341,8 +374,8 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
341
374
|
const pageInfo = `${result.hits.length} on this page · ${result.totalCount} total`;
|
|
342
375
|
const cursorInfo = result.nextCursor ? ' · more available' : '';
|
|
343
376
|
lines.push(`**Search (${result.mode}) — ${pageInfo}${cursorInfo}**`);
|
|
344
|
-
if (result.mode === 'omnisearch' && result.
|
|
345
|
-
lines.push(`
|
|
377
|
+
if (result.mode === 'omnisearch' && result.truncatedReason) {
|
|
378
|
+
lines.push(`_Truncated (${result.truncatedReason}): ${OMNISEARCH_TRUNCATIONS[result.truncatedReason]}_`);
|
|
346
379
|
}
|
|
347
380
|
if (result.nextCursor) {
|
|
348
381
|
lines.push(`_Next page cursor: ${inlineCode(result.nextCursor)}_`);
|
|
@@ -387,15 +420,15 @@ export function buildSearchNotesTool({ omnisearchReachable }) {
|
|
|
387
420
|
/**
|
|
388
421
|
* Static specimen for the MCP definition linter (which duck-types tool
|
|
389
422
|
* exports out of each `.tool.ts` file) and for existing tests that import
|
|
390
|
-
* the tool directly.
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
423
|
+
* the tool directly. Built without the `omnisearch` mode — the safe baseline
|
|
424
|
+
* that doesn't assume the optional plugin is installed. The entry point
|
|
425
|
+
* (`src/index.ts`) builds the live tool via `buildSearchNotesTool` with the
|
|
426
|
+
* startup `omnisearchAvailability`; this export is not the registered tool.
|
|
394
427
|
* The omnisearch-enabled variant is exercised by tests rather than the
|
|
395
428
|
* linter (two exports under the same tool name would collide on
|
|
396
429
|
* `name-unique`).
|
|
397
430
|
*/
|
|
398
|
-
export const obsidianSearchNotes = buildSearchNotesTool({
|
|
431
|
+
export const obsidianSearchNotes = buildSearchNotesTool({ omnisearch: 'unreachable' });
|
|
399
432
|
/**
|
|
400
433
|
* Apply MCP-spec cursor pagination to a fully assembled, post-filter result
|
|
401
434
|
* array. Returns the page's hits, the total pre-pagination count, and
|
|
@@ -412,6 +445,18 @@ function paginate(items, cursor, ctx, walk) {
|
|
|
412
445
|
...(nextCursor !== undefined ? { nextCursor } : {}),
|
|
413
446
|
};
|
|
414
447
|
}
|
|
448
|
+
/**
|
|
449
|
+
* The walk a cursor names, if any, and the index just past the page it asks
|
|
450
|
+
* for, as `paginate` will slice it. A scoped search's cursor names the walk its
|
|
451
|
+
* first page stored, so the later pages read that stored hit list instead of
|
|
452
|
+
* searching again.
|
|
453
|
+
*/
|
|
454
|
+
function cursorPage(cursor, ctx) {
|
|
455
|
+
if (!cursor)
|
|
456
|
+
return [undefined, DEFAULT_PAGE_SIZE];
|
|
457
|
+
const { offset, limit, walk } = decodeCursor(cursor, requestContext(ctx));
|
|
458
|
+
return [typeof walk === 'string' ? walk : undefined, offset + Math.min(limit, MAX_PAGE_SIZE)];
|
|
459
|
+
}
|
|
415
460
|
/**
|
|
416
461
|
* The `Context` → `RequestContext` cast the cursor helpers need — their
|
|
417
462
|
* signatures require the index-signature shape that handler-facing `Context`
|
|
@@ -420,15 +465,33 @@ function paginate(items, cursor, ctx, walk) {
|
|
|
420
465
|
function requestContext(ctx) {
|
|
421
466
|
return ctx;
|
|
422
467
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
468
|
+
/**
|
|
469
|
+
* Why Omnisearch's 50-hit cap may have cut matches from a result, or
|
|
470
|
+
* `undefined` when the result is complete: a full cap, or a query Omnisearch
|
|
471
|
+
* filters after the cap (`filteredAfterCap`), leaves it unknown.
|
|
472
|
+
*/
|
|
473
|
+
function omnisearchTruncation(query, upstreamHits) {
|
|
474
|
+
if (upstreamHits >= OMNISEARCH_UPSTREAM_CAP)
|
|
475
|
+
return 'cap_reached';
|
|
476
|
+
if (filteredAfterCap(query))
|
|
477
|
+
return 'filtered_after_cap';
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* True when Omnisearch (1.31.0) may filter `query`'s results after its cap:
|
|
482
|
+
* it applies quoted terms (any `"`, or a term opening with `'`, which its
|
|
483
|
+
* parser reads as a quoted phrase) and `-exclusion` terms once it has kept
|
|
484
|
+
* its top 50, while `path:`, `ext:`, and `-path:` apply before. Read
|
|
485
|
+
* generously: a query that might be filtered after the cap counts as one that
|
|
486
|
+
* is.
|
|
487
|
+
*/
|
|
488
|
+
function filteredAfterCap(query) {
|
|
489
|
+
if (query.includes('"'))
|
|
490
|
+
return true;
|
|
491
|
+
return query
|
|
492
|
+
.split(/\s+/)
|
|
493
|
+
.some((term) => term.startsWith("'") ||
|
|
494
|
+
(term.length > 1 && term.startsWith('-') && !/^-(?:path|ext):/i.test(term)));
|
|
432
495
|
}
|
|
433
496
|
/**
|
|
434
497
|
* Wrap upstream-authored text in a code fence long enough that nothing inside
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-search-notes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-search-notes.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAgB,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,aAAa,GACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,iFAAiF;AACjF,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,EAAE;KACR,QAAQ,EAAE;KACV,QAAQ,CACP,+NAA+N,CAChO,CAAC;AAEJ,MAAM,aAAa,GAAG,CAAC;KACpB,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IAC1E,OAAO,EAAE,CAAC;SACP,KAAK,CACJ,CAAC;SACE,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QACrE,KAAK,EAAE,CAAC;aACL,MAAM,CAAC;YACN,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,CAC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,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QAC/E,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;IACtB,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,KAAK;QAChB,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK,CAAC,MAAM;QAC3C,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,GAAY;IAClC,OAAO,GAAgC,CAAC;AAC1C,CAAC;AAED,SAAS,WAAW,CAClB,GAAM,EACN,GAAW;IAEX,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IAC1C,OAAO;QACL,GAAG,GAAG;QACN,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;QAClC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM;KACjC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,IAAI,GAAG,MAAM;IACzC,OAAO,QAAQ,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAU;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"obsidian-search-notes.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-search-notes.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AE,IAAI,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -57,8 +57,8 @@ export declare const obsidianWriteNote: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
57
57
|
readonly reason: "path_forbidden";
|
|
58
58
|
readonly thrownBy: "service";
|
|
59
59
|
readonly code: JsonRpcErrorCode.Forbidden;
|
|
60
|
-
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
61
|
-
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope.";
|
|
60
|
+
readonly when: "The target path is outside OBSIDIAN_WRITE_PATHS or inside OBSIDIAN_DENY_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.";
|
|
61
|
+
readonly recovery: "Use a path inside the configured write scope. The error data echoes the active scope; a `denied_path` denial carries none, since the operator withholds that path.";
|
|
62
62
|
}, {
|
|
63
63
|
readonly reason: "note_missing";
|
|
64
64
|
readonly thrownBy: "service";
|
|
@@ -107,6 +107,12 @@ export declare const obsidianWriteNote: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
107
107
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
108
108
|
readonly when: "On Local REST API v5.0 and later, the new body of a heading section carries a heading at or above that section’s own level, which would have to sit outside the section.";
|
|
109
109
|
readonly recovery: "Append the heading at the parent section or at the end of the note with obsidian_append_to_note, or write it one level below the target section or deeper.";
|
|
110
|
+
}, {
|
|
111
|
+
readonly reason: "repeated_link_definition";
|
|
112
|
+
readonly thrownBy: "service";
|
|
113
|
+
readonly code: JsonRpcErrorCode.Conflict;
|
|
114
|
+
readonly when: "A link reference definition that repeats a label defined earlier in the note sits above where the target heading’s section ends (for the last section, above its heading); the Local REST API’s markdown parser drops it and misplaces every heading below it, so the replacement would land outside the section.";
|
|
115
|
+
readonly recovery: "Use obsidian_replace_in_note to place the new body directly, or to remove or rename the repeated definition at `line`, then retry the section write.";
|
|
110
116
|
}, {
|
|
111
117
|
readonly reason: "patch_rejected";
|
|
112
118
|
readonly thrownBy: "service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-write-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"obsidian-write-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuP5B,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { scanHeadings } from '../../../services/obsidian/section-extractor.js';
|
|
|
11
11
|
import { ContentTypeSchema, SectionSchema, TargetSchema } from './_shared/schemas.js';
|
|
12
12
|
import { caseVariantError, findCaseVariants, withCaseVariantNamed, } from './_shared/suggest-paths.js';
|
|
13
13
|
export const obsidianWriteNote = tool('obsidian_write_note', {
|
|
14
|
-
description: 'Create or overwrite a note. With `section`, replaces just that heading/block/frontmatter section in place — use `obsidian_get_note` with `format: "document-map"` to discover available targets. Name a heading by its full `Parent::Child` path as the document map lists it, or by a bare leaf name matched at any depth. A leaf shared by several headings is rejected with `ambiguous_section`, unless one of them has no parent heading, in which case the write targets that one; a full path that occurs more than once in the note is rejected with `ambiguous_section` too. Whole-file writes fail with `file_exists` against an existing note unless `overwrite: true`, and with `case_variant_exists` when the path differs from an existing note only in letter case on a case-insensitive filesystem (`existingPath` names the note when the folder listing shows exactly one case match) — for in-place edits, prefer `obsidian_patch_note` (sections), `obsidian_append_to_note` (append), or `obsidian_replace_in_note` (find-and-replace). For heading sections, `content` is the new body; the heading line is preserved automatically.',
|
|
14
|
+
description: 'Create or overwrite a note. With `section`, replaces just that heading/block/frontmatter section in place — use `obsidian_get_note` with `format: "document-map"` to discover available targets. Name a heading by its full `Parent::Child` path as the document map lists it, or by a bare leaf name matched at any depth. A leaf shared by several headings is rejected with `ambiguous_section`, unless one of them has no parent heading, in which case the write targets that one; a full path that occurs more than once in the note is rejected with `ambiguous_section` too. A heading section is rejected with `repeated_link_definition` when a link reference definition that repeats an earlier label sits above where it ends (for the last section, above its heading), which makes the plugin misplace the headings below it. Whole-file writes fail with `file_exists` against an existing note unless `overwrite: true`, and with `case_variant_exists` when the path differs from an existing note only in letter case on a case-insensitive filesystem (`existingPath` names the note when the folder listing shows exactly one case match) — for in-place edits, prefer `obsidian_patch_note` (sections), `obsidian_append_to_note` (append), or `obsidian_replace_in_note` (find-and-replace). For heading sections, `content` is the new body; the heading line is preserved automatically.',
|
|
15
15
|
annotations: { idempotentHint: true, destructiveHint: true },
|
|
16
16
|
input: z.object({
|
|
17
17
|
target: TargetSchema.describe('Where the note lives.'),
|
|
@@ -62,8 +62,8 @@ export const obsidianWriteNote = tool('obsidian_write_note', {
|
|
|
62
62
|
reason: 'path_forbidden',
|
|
63
63
|
thrownBy: 'service',
|
|
64
64
|
code: JsonRpcErrorCode.Forbidden,
|
|
65
|
-
when: 'The target path is outside OBSIDIAN_WRITE_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.',
|
|
66
|
-
recovery: 'Use a path inside the configured write scope. The error data echoes the active scope.',
|
|
65
|
+
when: 'The target path is outside OBSIDIAN_WRITE_PATHS or inside OBSIDIAN_DENY_PATHS, or OBSIDIAN_READ_ONLY=true denies all writes.',
|
|
66
|
+
recovery: 'Use a path inside the configured write scope. The error data echoes the active scope; a `denied_path` denial carries none, since the operator withholds that path.',
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
reason: 'note_missing',
|
|
@@ -121,6 +121,13 @@ export const obsidianWriteNote = tool('obsidian_write_note', {
|
|
|
121
121
|
when: 'On Local REST API v5.0 and later, the new body of a heading section carries a heading at or above that section’s own level, which would have to sit outside the section.',
|
|
122
122
|
recovery: 'Append the heading at the parent section or at the end of the note with obsidian_append_to_note, or write it one level below the target section or deeper.',
|
|
123
123
|
},
|
|
124
|
+
{
|
|
125
|
+
reason: 'repeated_link_definition',
|
|
126
|
+
thrownBy: 'service',
|
|
127
|
+
code: JsonRpcErrorCode.Conflict,
|
|
128
|
+
when: 'A link reference definition that repeats a label defined earlier in the note sits above where the target heading’s section ends (for the last section, above its heading); the Local REST API’s markdown parser drops it and misplaces every heading below it, so the replacement would land outside the section.',
|
|
129
|
+
recovery: 'Use obsidian_replace_in_note to place the new body directly, or to remove or rename the repeated definition at `line`, then retry the section write.',
|
|
130
|
+
},
|
|
124
131
|
{
|
|
125
132
|
reason: 'patch_rejected',
|
|
126
133
|
thrownBy: 'service',
|
|
@@ -183,8 +190,8 @@ export const obsidianWriteNote = tool('obsidian_write_note', {
|
|
|
183
190
|
*/
|
|
184
191
|
const { exact, variants } = await findCaseVariants(ctx, svc, path);
|
|
185
192
|
if (!exact && variants.length > 0) {
|
|
186
|
-
const { message, data } = caseVariantError(path, variants);
|
|
187
|
-
throw ctx.fail('case_variant_exists', message, data);
|
|
193
|
+
const { message, data, literals } = caseVariantError(path, variants);
|
|
194
|
+
throw ctx.fail('case_variant_exists', message, data, { literals });
|
|
188
195
|
}
|
|
189
196
|
throw ctx.fail('file_exists', `Note '${path}' already exists.`, {
|
|
190
197
|
path,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-write-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"obsidian-write-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-write-note.tool.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,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