notes_createRawHtml
Create Apple Notes with custom HTML formatting by providing raw HTML content and a title for structured note creation.
Instructions
[Apple Notes operations] Create a new note with direct HTML content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the note | |
| html | Yes | Raw HTML content for the note |
Implementation Reference
- src/categories/notes.ts:171-179 (handler)The core handler function for the 'notes_createRawHtml' tool. It takes input arguments (title and html), escapes double quotes in the HTML content, and generates an AppleScript string to create a new note in the Apple Notes application with the specified title and raw HTML body.script: (args) => { const { title = "New Note", html = "" } = args; return ` tell application "Notes" make new note with properties {body:"${html.replace(/"/g, '\\"')}", name:"${title}"} end tell `; },
- src/categories/notes.ts:180-193 (schema)JSON Schema defining the input parameters for the 'notes_createRawHtml' tool: required 'title' (string) and 'html' (string for raw HTML content).schema: { type: "object", properties: { title: { type: "string", description: "Title of the note" }, html: { type: "string", description: "Raw HTML content for the note" } }, required: ["title", "html"] }
- src/categories/notes.ts:169-194 (registration)The tool definition registered within the 'notes' category's scripts array. The full MCP tool name is constructed as 'notes_createRawHtml' by prefixing the category name.name: "createRawHtml", description: "Create a new note with direct HTML content", script: (args) => { const { title = "New Note", html = "" } = args; return ` tell application "Notes" make new note with properties {body:"${html.replace(/"/g, '\\"')}", name:"${title}"} end tell `; }, schema: { type: "object", properties: { title: { type: "string", description: "Title of the note" }, html: { type: "string", description: "Raw HTML content for the note" } }, required: ["title", "html"] } },
- src/index.ts:35-35 (registration)The 'notesCategory' (containing the 'createRawHtml' script) is registered to the MCP server via addCategory, making the tool available.server.addCategory(notesCategory);
- src/framework.ts:224-224 (registration)Tool name construction in ListToolsRequestSchema handler: combines category.name + '_' + script.name to form 'notes_createRawHtml'.name: `${category.name}_${script.name}`, // Changed from dot to underscore