create-note-with-attachment
Create a new Apple Note with one local file attachment in a single call. It checks the filename and file before creating the note, then verifies the attachment.
Instructions
Use when: creating a new note that holds one local file, in one call. Returns: the new note id plus the add-attachment result (attachment id, bytes, name, content hash). Do not use when: the note already exists (add-attachment). Safety: checks the file and filename before creating anything, with the same read scope as add-attachment (home, temp or /Volumes; no hidden paths or ~/Library outside iCloud Drive and CloudStorage), creates the note through Notes.app like create-note, then attaches with the same byte verification as add-attachment. If the attachment step fails before the file is inserted, the error names the new note's id; attach to it with add-attachment instead of creating another note. If insertion started but could not be verified, the outcome is uncertain: read the note with list-attachments before attaching again.
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": {
"title": "<title>",
"path": "<path>"
},
"name": "create-note-with-attachment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the local regular file to attach, in home, temp or /Volumes; hidden paths and ~/Library (except iCloud Drive and CloudStorage) are refused | |
| title | Yes | ||
| folder | No | Existing folder or nested path; create it first with create-folder. A smart folder is refused before the note is created | |
| account | No | Account name; defaults to Notes' default | |
| content | No | Optional plain-text body placed above the attachment | |
| filename | No | Name the attachment gets in Notes instead of the source file's name. One path component with the source file's extension; no slash, colon, or control characters, and no leading dot. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No |