Skip to main content
Glama

Duplicate Shortcut

duplicate_shortcut

Duplicate any Siri Shortcut by specifying the original and new name. Creates an exact copy of the shortcut.

Instructions

Duplicate an existing Siri Shortcut.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the shortcut to duplicate (exact match)
newNameYesName for the duplicated shortcut

Implementation Reference

  • Registration of the duplicate_shortcut tool with its input schema (name, newName) and handler that calls duplicateShortcutScript via JXA.
    server.registerTool(
      "duplicate_shortcut",
      {
        title: "Duplicate Shortcut",
        description:
          "Duplicate an existing Siri Shortcut. Exports the shortcut to a temporary file and re-imports it with a new name.",
        inputSchema: {
          name: z.string().max(500).describe("Name of the shortcut to duplicate (exact match)"),
          newName: z.string().max(500).describe("Name for the duplicated shortcut"),
        },
        annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
      },
      async ({ name, newName }) => {
        try {
          return ok(await runJxa(duplicateShortcutScript(name, newName)));
        } catch (e) {
          return errJxaFor("duplicate shortcut", e);
        }
      },
    );
  • Handler function for duplicate_shortcut: runs the JXA script via runJxa and wraps result in ok() or errJxaFor().
    async ({ name, newName }) => {
      try {
        return ok(await runJxa(duplicateShortcutScript(name, newName)));
      } catch (e) {
        return errJxaFor("duplicate shortcut", e);
      }
    },
  • Input schema definition for duplicate_shortcut: requires 'name' (source shortcut) and 'newName' (duplicate name), both strings max 500 chars.
    inputSchema: {
      name: z.string().max(500).describe("Name of the shortcut to duplicate (exact match)"),
      newName: z.string().max(500).describe("Name for the duplicated shortcut"),
    },
  • JXA script generator that exports the original shortcut to a temp file, imports it (creating a duplicate), then deletes the temp file.
    export function duplicateShortcutScript(name: string, newName: string): string {
      const safeName = escJxaShell(newName).replace(/[^a-zA-Z0-9_-]/g, "_");
      // Inline a unique temp file path so concurrent duplicates don't collide and
      // sandboxed runtimes can redirect via AIRMCP_TEMP_DIR.
      const tempFile = join(PATHS.TEMP_DIR, `${safeName}-${Date.now()}.shortcut`);
      return `
        const app = Application.currentApplication();
        app.includeStandardAdditions = true;
        app.doShellScript('shortcuts export "${escJxaShell(name)}" -o "${tempFile}" && shortcuts import "${tempFile}"');
        app.doShellScript('rm -f "${tempFile}"');
        JSON.stringify({original: '${esc(name)}', duplicate: '${esc(newName)}', success: true});
      `;
    }
Behavior2/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, but the description adds no behavioral context beyond 'duplicate'. It does not mention side effects, error conditions, or what happens if the new name already exists.

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

Conciseness5/5

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

Single sentence with no unnecessary words. Efficiently conveys the core action.

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

Completeness3/5

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

For a simple tool with well-documented parameters, the description is adequate but minimal. Lacks return value info and error handling, which would be helpful given no output schema.

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 baseline is 3. The description does not add extra meaning beyond the parameter descriptions already present.

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 'Duplicate an existing Siri Shortcut' clearly states the verb and resource. It is not a tautology and differentiates from creation, import, and run, though it does not explicitly contrast with sibling tools.

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 on when to use this tool vs alternatives like create_shortcut or import_shortcut. No when-not-to-use or prerequisites mentioned.

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/heznpc/AirMCP'

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