edit_note
Change a passage in a note
Writes: one commit per change Can remove or replace
Description
What the model reads, word for word:
Replaces one passage of a note with new text, leaving the rest untouched.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
path |
string |
yes | The note to change, from the vault root, for example “projects/apollo/plan.md”. It must exist. |
old_text |
string |
yes | The passage to replace, exactly as it stands in the note today, including indentation and line breaks. It has to appear exactly once — if it does not, take more of the lines above or below it until it is unique. To add lines without changing any, send the neighbouring line here and that line plus the new ones as new_text. |
new_text |
string |
yes | What should stand there instead. An empty string deletes the passage. Everything else in the note is left untouched, down to the spacing. On a table row, a link with a label is written [[note\ |
summary |
string |
yes | Git history. First line: what changed, at most 60 characters, no client or project (the server adds it), e.g. “Marked trial price as an assumption”. More lines, optional: why. |
more_edits |
object[] |
Further passages of the same change, made after the first one, in this order and in the same commit: one correction that touches several places is one step in the history. If any cannot be made, none is. | |
more_edits[].path |
string |
yes | The note, as a path relative to the vault root. May be the same note as another edit, or a different one. |
more_edits[].old_text |
string |
yes | The passage to replace, exactly as it stands in the note once the edits before this one are made. It has to appear exactly once. |
more_edits[].new_text |
string |
yes | What should stand there instead. An empty string deletes the passage. In the frontmatter, a value holding “: “ goes in single quotes. |
repo |
"handbook" | "projects" |
yes | The repository this call works in. One of the repositories the person can read; the values above are Acme’s. |
Result
As structuredContent and, the same, as a text block.
| Field | Type | Description |
|---|---|---|
path |
string |
The note of the first change. |
line |
number |
The line the first replaced passage started on, counting from 1. |
changes |
object[] |
|
changes[].path |
string |
The note. |
changes[].line |
number |
The line the passage started on, in the note as the edits before it left it. |
changes[].repo |
string |
|
commit |
string |
Hash of the commit that now holds the change, as Git recorded it. |
note |
string |
|
repo |
string |
As listed
The entry in tools/list, captured from the service for Acme’s two repositories.
{
"name": "edit_note",
"title": "Change a passage in a note",
"description": "Replaces one passage of a note with new text, leaving the rest untouched.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"path": {
"type": "string",
"description": "The note to change, from the vault root, for example \"projects/apollo/plan.md\". It must exist."
},
"old_text": {
"type": "string",
"description": "The passage to replace, exactly as it stands in the note today, including indentation and line breaks. It has to appear exactly once — if it does not, take more of the lines above or below it until it is unique. To add lines without changing any, send the neighbouring line here and that line plus the new ones as new_text."
},
"new_text": {
"type": "string",
"description": "What should stand there instead. An empty string deletes the passage. Everything else in the note is left untouched, down to the spacing. On a table row, a link with a label is written [[note\\|label]], because a bare | would start a new cell; a bare | inside such a link gets its backslash, and the answer says so. In the frontmatter, a value holding \": \" goes in single quotes, or the YAML breaks and the edit is refused."
},
"summary": {
"type": "string",
"minLength": 1,
"description": "Git history. First line: what changed, at most 60 characters, no client or project (the server adds it), e.g. \"Marked trial price as an assumption\". More lines, optional: why."
},
"more_edits": {
"description": "Further passages of the same change, made after the first one, in this order and in the same commit: one correction that touches several places is one step in the history. If any cannot be made, none is.",
"minItems": 1,
"maxItems": 30,
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The note, as a path relative to the vault root. May be the same note as another edit, or a different one."
},
"old_text": {
"type": "string",
"description": "The passage to replace, exactly as it stands in the note once the edits before this one are made. It has to appear exactly once."
},
"new_text": {
"type": "string",
"description": "What should stand there instead. An empty string deletes the passage. In the frontmatter, a value holding \": \" goes in single quotes."
}
},
"required": [
"path",
"old_text",
"new_text"
]
}
},
"repo": {
"type": "string",
"description": "The repository this call works in.",
"anyOf": [
{
"const": "handbook",
"description": "How Acme works: onboarding, processes and policies."
},
{
"const": "projects",
"description": "One folder per project: plans, decisions and meeting notes."
}
]
}
},
"required": [
"path",
"old_text",
"new_text",
"summary",
"repo"
]
},
"annotations": {
"readOnlyHint": false,
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": false
},
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The note of the first change."
},
"line": {
"type": "number",
"description": "The line the first replaced passage started on, counting from 1."
},
"changes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The note."
},
"line": {
"type": "number",
"description": "The line the passage started on, in the note as the edits before it left it."
},
"repo": {
"type": "string"
}
},
"required": [
"path",
"line"
],
"additionalProperties": false
}
},
"commit": {
"type": "string",
"description": "Hash of the commit that now holds the change, as Git recorded it."
},
"note": {
"type": "string"
},
"repo": {
"type": "string"
}
},
"required": [
"path",
"line",
"commit"
],
"additionalProperties": false
}
}