insert-link
Insert a web, mail, or Notes link into a specific Apple Notes note as a raw URL or labeled hyperlink, using revision checks to prevent overwriting changes.
Instructions
Use when: adding one web, mail or Notes link to an exact note, either as the raw URL (mode 'raw') or as label text that links to the URL (mode 'hyperlink'). Returns: exact id, the route used, whether Notes stored a link on the inserted text, the stored destination read back from the note, and the new content hash. Do not use when: linking to another note by id (insert-note-link fetches its real deep link), or you want a rich URL preview card (not available: no public automation route creates one). Safety: same guards as append-to-note (fresh expectedContentHash, attachment block, existing links must survive). Notes with native objects use native end-append and need scopeText; there only position 'end' with a blank line is supported. The link is placed in its own paragraph at the end or directly after the title; placing it inside an existing paragraph is not supported.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"expectedContentHash": "<expectedContentHash>",
"url": "<url>"
},
"name": "insert-link"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Exact note ID returned by search-notes, list-notes, or create-note: x-coredata id, Notes UUID, or numeric key | |
| url | Yes | Link destination: absolute http(s) URL with a host, or a mailto:, notes:// or applenotes: link. No spaces. | |
| mode | No | 'raw' (default) shows the URL itself; 'hyperlink' shows `label` linking to the URL | raw |
| label | No | Visible text for mode 'hyperlink' (required there, refused in raw mode) | |
| linked | No | Raw mode only. true (default) stores a real link on the URL text. false writes plain text with no stored link; Notes may still detect it when displaying, and the result reports linkStored. | |
| position | No | 'end' (default) or 'after-title' (first paragraph below the title) | end |
| blankLine | No | Leave a blank line between existing text and the link paragraph (default true; native-object notes require true) | |
| scopeText | No | Existing unique phrase; required only for notes with native objects | |
| expectedContentHash | Yes | Revision token returned by get-note-content for this exact ID. The mutation stops if the note changed since that read. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ||
| ok | No | ||
| url | No | ||
| mode | No | ||
| text | No | ||
| route | No | ||
| position | No | ||
| storedUrl | No | ||
| linkStored | No | ||
| contentHash | No | ||
| previousContentHash | No |