pages_create_document
Create a new Pages document with plain text content using AppleScript automation for macOS.
Instructions
[Pages document operations] Create a new Pages document with plain text content (no formatting)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The plain text content to add to the document (no formatting) |
Implementation Reference
- src/categories/pages.ts:24-37 (handler)The handler function that generates AppleScript code to create a new Pages document and set its body text to the provided plain text content.script: (args) => ` try tell application "Pages" -- Create new document set newDoc to make new document set the body text of newDoc to "${args.content.replace(/"/g, '\\"')}" activate return "Document created successfully with plain text content" end tell on error errMsg return "Failed to create document: " & errMsg end try `
- src/categories/pages.ts:14-22 (schema)Input schema requiring a 'content' string parameter for the document text.schema: { type: "object", properties: { content: { type: "string", description: "The plain text content to add to the document (no formatting)" } }, required: ["content"]
- src/index.ts:32-32 (registration)Registers the pages category, which includes the create_document tool, with the MCP server.server.addCategory(pagesCategory);
- src/index.ts:9-9 (registration)Imports the pages category definition containing the create_document tool.import { pagesCategory } from "./categories/pages.js";
- src/framework.ts:224-224 (helper)Constructs the MCP tool name in the format 'category_script', resulting in 'pages_create_document' for this tool.name: `${category.name}_${script.name}`, // Changed from dot to underscore