Skip to main content
Glama

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
NameRequiredDescriptionDefault
titleYesTitle of the note
htmlYesRaw HTML content for the note

Implementation Reference

  • 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
      `;
    },
  • 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"]
    }
  • 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);
  • 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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/joshrutkowski/applescript-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server