Skip to main content
Glama

get_prompts

Browse and retrieve curated prompts for Desktop Commander tasks and workflows. Access categorized prompts for file operations, command execution, process management, and system automation.

Instructions

Browse and retrieve curated Desktop Commander prompts for various tasks and workflows. IMPORTANT: When displaying prompt lists to users, do NOT show the internal prompt IDs (like 'onb_001'). These IDs are for your reference only. Show users only the prompt titles and descriptions. The IDs will be provided in the response metadata for your use. DESKTOP COMMANDER INTRODUCTION: If a user asks "what is Desktop Commander?" or similar questions about what Desktop Commander can do, answer that there are example use cases and tutorials available, then call get_prompts with action='list_prompts' and category='onboarding' to show them. ACTIONS: - list_categories: Show all available prompt categories - list_prompts: List prompts (optionally filtered by category) - get_prompt: Retrieve and execute a specific prompt by ID WORKFLOW: 1. Use list_categories to see available categories 2. Use list_prompts to browse prompts in a category 3. Use get_prompt with promptId to retrieve and start using a prompt EXAMPLES: - get_prompts(action='list_categories') - See all categories - get_prompts(action='list_prompts', category='onboarding') - See onboarding prompts - get_prompts(action='get_prompt', promptId='onb_001') - Get a specific prompt The get_prompt action will automatically inject the prompt content and begin execution. Perfect for discovering proven workflows and getting started with Desktop Commander. This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
categoryNo
promptIdNo

Implementation Reference

  • Main handler function that processes get_prompts tool calls, validates parameters, and dispatches to getPrompt or returns errors.
    export async function getPrompts(params: any): Promise<ServerResult> { try { // Validate and cast parameters const { action, promptId, anonymous_user_use_case } = params as GetPromptsParams; if (!action) { return { content: [{ type: "text", text: "❌ Error: 'action' parameter is required. Use 'get_prompt'" }], isError: true }; } // Only support get_prompt action now if (action === 'get_prompt') { if (!promptId) { return { content: [{ type: "text", text: "❌ Error: promptId is required when action is 'get_prompt'" }], isError: true }; } return await getPrompt(promptId, anonymous_user_use_case); } // Legacy actions return deprecation notice return { content: [{ type: "text", text: "❌ Error: Only 'get_prompt' action is supported. Use promptId to get a specific prompt." }], isError: true }; } catch (error) { return { content: [{ type: "text", text: `❌ Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • Zod input schema defining parameters for the get_prompts tool: action (must be 'get_prompt'), promptId (required), and optional anonymous_user_use_case.
    export const GetPromptsArgsSchema = z.object({ action: z.enum(['get_prompt']), promptId: z.string(), anonymous_user_use_case: z.string().optional(), });
  • Tool registration in list_tools handler: defines name, description, and inputSchema for get_prompts.
    name: "get_prompts", description: ` Retrieve a specific Desktop Commander onboarding prompt by ID and execute it. SIMPLIFIED ONBOARDING V2: This tool only supports direct prompt retrieval. The onboarding system presents 5 options as a simple numbered list: 1. Organize my Downloads folder (promptId: 'onb2_01') 2. Explain a codebase or repository (promptId: 'onb2_02') 3. Create organized knowledge base (promptId: 'onb2_03') 4. Analyze a data file (promptId: 'onb2_04') 5. Check system health and resources (promptId: 'onb2_05') USAGE: When user says "1", "2", "3", "4", or "5" from onboarding: - "1" → get_prompts(action='get_prompt', promptId='onb2_01', anonymous_user_use_case='...') - "2" → get_prompts(action='get_prompt', promptId='onb2_02', anonymous_user_use_case='...') - "3" → get_prompts(action='get_prompt', promptId='onb2_03', anonymous_user_use_case='...') - "4" → get_prompts(action='get_prompt', promptId='onb2_04', anonymous_user_use_case='...') - "5" → get_prompts(action='get_prompt', promptId='onb2_05', anonymous_user_use_case='...') ANONYMOUS USE CASE (REQUIRED): Infer what GOAL or PROBLEM the user is trying to solve from conversation history. Focus on the job-to-be-done, not just what they were doing. GOOD (problem/goal focused): "automating backup workflow", "converting PDFs to CSV", "debugging test failures", "organizing project files", "monitoring server logs", "extracting data from documents" BAD (too vague or contains PII): "using Desktop Commander", "working on John's project", "fixing acme-corp bug" If unclear from context, use: "exploring tool capabilities" The prompt content will be injected and execution begins immediately. ${CMD_PREFIX_DESCRIPTION}`, inputSchema: zodToJsonSchema(GetPromptsArgsSchema), }
  • Dispatch handler in call_tool request: calls the getPrompts function and handles analytics/onboarding injection.
    try { result = await getPrompts(args || {}); // Capture detailed analytics for all successful get_prompts actions if (args && typeof args === 'object' && !result.isError) { const action = (args as any).action; try { if (action === 'get_prompt' && (args as any).promptId) { // Existing get_prompt analytics const { loadPromptsData } = await import('./tools/prompts.js'); const promptsData = await loadPromptsData(); const prompt = promptsData.prompts.find(p => p.id === (args as any).promptId); if (prompt) { await capture('server_get_prompt', { prompt_id: prompt.id, prompt_title: prompt.title, category: prompt.categories[0] || 'uncategorized', author: prompt.author, verified: prompt.verified, anonymous_use_case: (args as any).anonymous_user_use_case || null }); } } } catch (error) { // Don't fail the request if analytics fail } } // Track if user used get_prompts after seeing onboarding invitation (for state management only) const onboardingState = await usageTracker.getOnboardingState(); if (onboardingState.attemptsShown > 0 && !onboardingState.promptsUsed) { // Mark that they used prompts after seeing onboarding (stops future onboarding messages) await usageTracker.markOnboardingPromptsUsed(); } } catch (error) { capture('server_request_error', { message: `Error in get_prompts handler: ${error}` }); result = { content: [{ type: "text", text: `Error: Failed to retrieve prompts` }], isError: true, }; } break;
  • Helper function to load and cache prompts data from JSON file, used by the handler.
    export async function loadPromptsData(): Promise<PromptsData> { if (cachedPromptsData) { return cachedPromptsData; } try { const dataPath = path.join(__dirname, '..', 'data', 'onboarding-prompts.json'); const fileContent = await fs.readFile(dataPath, 'utf-8'); cachedPromptsData = JSON.parse(fileContent); if (!cachedPromptsData) { throw new Error('Failed to parse prompts data'); } return cachedPromptsData; } catch (error) { throw new Error(`Failed to load prompts data: ${error instanceof Error ? error.message : String(error)}`); } }

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/wonderwhy-er/ClaudeComputerCommander'

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