Skip to main content
Glama

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
NameRequiredDescriptionDefault
contentYesThe plain text content to add to the document (no formatting)

Implementation Reference

  • 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
    `
  • 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";
  • 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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states it creates a document with plain text. It doesn't disclose behavioral traits like permissions needed, whether the document is saved automatically, error conditions, or what happens on success/failure. This is inadequate for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded with the core purpose. It uses only one sentence without unnecessary details, though it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, error handling, or important behavioral aspects like where the document is saved or if it requires specific permissions, leaving significant gaps for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single 'content' parameter. The description adds minimal value by repeating 'plain text content (no formatting)' but doesn't provide additional semantics like length limits, encoding, or examples beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create') and resource ('new Pages document'), specifying it's for Pages document operations. It distinguishes from other tools by focusing on document creation rather than retrieval or other operations, though it doesn't explicitly differentiate from similar tools like notes_create.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description mentions 'plain text content (no formatting)' but doesn't explain when to choose this over formatted options or other document creation tools, leaving the agent without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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