Get Shortcut Detail
get_shortcut_detailRetrieve details and actions of any Siri Shortcut by name. Get full shortcut structure for analysis or integration.
Instructions
Get details about a Siri Shortcut including its actions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Shortcut name (exact match) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| shortcut | Yes | ||
| detail | Yes |
Implementation Reference
- src/shortcuts/tools.ts:108-129 (handler)The tool registration and handler for 'get_shortcut_detail'. Calls getShortcutDetailScript(name) via JXA and returns the result structured with an okStructured response.
server.registerTool( "get_shortcut_detail", { title: "Get Shortcut Detail", description: "Get details about a Siri Shortcut including its actions.", inputSchema: { name: z.string().max(500).describe("Shortcut name (exact match)"), }, outputSchema: { shortcut: z.string(), detail: z.string(), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, }, async ({ name }) => { try { return okStructured(await runJxa<ShortcutsDetail>(getShortcutDetailScript(name))); } catch (e) { return errJxaFor("get shortcut detail", e); } }, ); - src/shortcuts/scripts.ts:71-83 (helper)The JXA script generator function getShortcutDetailScript that builds a macOS JavaScript for Automation script. It runs 'shortcuts view <name>' via shell to retrieve shortcut details, falling back to 'Details not available' on error.
export function getShortcutDetailScript(name: string): string { return ` const app = Application.currentApplication(); app.includeStandardAdditions = true; let actions = ''; try { actions = app.doShellScript('shortcuts view "${escJxaShell(name)}" 2>&1 || true'); } catch(e) { actions = 'Details not available'; } JSON.stringify({shortcut: '${esc(name)}', detail: actions}); `; } - src/shortcuts/scripts.ts:18-21 (schema)The ShortcutsDetail interface defining the return shape: { shortcut: string, detail: string }.
export interface ShortcutsDetail { shortcut: string; detail: string; } - src/shortcuts/tools.ts:110-120 (schema)The input/output schema for get_shortcut_detail: input is a 'name' string (max 500 chars), output has 'shortcut' and 'detail' as strings.
{ title: "Get Shortcut Detail", description: "Get details about a Siri Shortcut including its actions.", inputSchema: { name: z.string().max(500).describe("Shortcut name (exact match)"), }, outputSchema: { shortcut: z.string(), detail: z.string(), }, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, - src/shortcuts/scripts.ts:34-37 (helper)Example fixture for the ShortcutsDetail shape used in contract tests.
export const GET_SHORTCUT_DETAIL_EXAMPLE: ShortcutsDetail = { shortcut: "Daily Brief", detail: "Actions: Get Current Weather, Get Today's Calendar Events, Combine Text, Create Note", };