Skip to main content
Glama

get_prompts

Read-only

Retrieve and execute specific onboarding prompts for Desktop Commander to organize files, analyze data, check system health, or create knowledge bases.

Instructions

                    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')
                    - "2" → get_prompts(action='get_prompt', promptId='onb2_02')
                    - "3" → get_prompts(action='get_prompt', promptId='onb2_03')
                    - "4" → get_prompts(action='get_prompt', promptId='onb2_04')
                    - "5" → get_prompts(action='get_prompt', promptId='onb2_05')
                    
                    The prompt content will be injected and execution begins immediately.

                    This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
promptIdYes

Implementation Reference

  • The primary handler function for the 'get_prompts' tool. Validates input parameters, handles the 'get_prompt' action by calling the helper getPrompt, and returns formatted ServerResult responses including error handling.
    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 schema for validating inputs to the get_prompts tool, requiring 'action' as 'get_prompt' and 'promptId'.
    export const GetPromptsArgsSchema = z.object({
      action: z.enum(['get_prompt']),
      promptId: z.string(),
      // Disabled to check if it makes sense or should be removed or changed
      // anonymous_user_use_case: z.string().optional(),
    });
  • Tool registration in the list_tools handler, defining the tool's name, description, input schema, and annotations for the MCP protocol.
    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')
            - "2" → get_prompts(action='get_prompt', promptId='onb2_02')
            - "3" → get_prompts(action='get_prompt', promptId='onb2_03')
            - "4" → get_prompts(action='get_prompt', promptId='onb2_04')
            - "5" → get_prompts(action='get_prompt', promptId='onb2_05')
            
            The prompt content will be injected and execution begins immediately.
    
            ${CMD_PREFIX_DESCRIPTION}`,
        inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
        annotations: {
            title: "Get Prompts",
            readOnlyHint: true,
        },
    }
  • Helper function to load and cache the prompts data from JSON file, used by the getPrompts 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)}`);
      }
    }
  • Core helper function that retrieves a specific prompt by ID, marks usage, formats the response, and returns it.
    async function getPrompt(promptId: string, anonymousUseCase?: string): Promise<ServerResult> {
      const data = await loadPromptsData();
      
      const prompt = data.prompts.find(p => p.id === promptId);
      
      if (!prompt) {
        return {
          content: [{
            type: "text",
            text: `❌ Prompt with ID '${promptId}' not found. Use action='list_prompts' to see available prompts.`
          }],
          isError: true
        };
      }
    
      // Mark prompt as used in user's onboarding state (for analytics)
      await usageTracker.markPromptUsed(promptId, prompt.categories[0] || 'uncategorized');
      
      const response = formatPromptResponse(prompt);
      
      return {
        content: [{
          type: "text",
          text: response
        }]
      };
    }
Behavior4/5

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

Annotations indicate readOnlyHint=true, and the description aligns by describing retrieval and execution without implying destructive actions. It adds valuable behavioral context beyond annotations: the tool executes prompts immediately after retrieval, and mentions that prompt content is injected, which helps the agent understand the flow. No contradictions with annotations.

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 well-structured with clear sections (purpose, simplified onboarding, usage, and reference), but it includes some redundant phrasing (e.g., 'This command can be referenced as...') that could be trimmed. Most sentences earn their place by providing essential information efficiently.

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

Completeness4/5

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

Given the tool's complexity (2 parameters, no output schema, read-only operation), the description is largely complete. It covers purpose, usage, parameter mapping, and behavioral aspects like immediate execution. However, it lacks details on error handling or response format, which could be useful for an agent.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It effectively explains parameter semantics: 'action' is implicitly defined as 'get_prompt' through usage examples, and 'promptId' is detailed with specific values (onb2_01 to onb2_05) mapped to user inputs. This adds significant meaning beyond the bare schema.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('retrieve' and 'execute') and resource ('Desktop Commander onboarding prompt by ID'), distinguishing it from siblings like get_config or get_file_info that handle different resources. It explicitly mentions what the tool does beyond just the name.

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

Usage Guidelines5/5

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

The description provides explicit usage guidelines with a 'USAGE' section detailing when to use this tool (when user selects options 1-5 from onboarding) and includes specific mapping examples (e.g., '1' → promptId='onb2_01'). It clearly defines the context without mentioning alternatives, which is appropriate given the specialized nature.

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

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