Skip to main content
Glama
jezweb

Smart Prompts MCP Server

get_prompt

Retrieve complete prompt content and metadata by exact name after using search_prompts to identify the correct prompt.

Instructions

šŸ“– Get Full Prompt: Retrieve a specific prompt by its exact name. āš ļø IMPORTANT: Use search_prompts first to find the correct prompt name, then use this tool. Returns the complete prompt content with metadata and template variables.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesExact prompt name from search results. Must match exactly (e.g., "api_documentation_generator", "REST API Endpoint Generator"). Copy the name field from search_prompts results.

Implementation Reference

  • Registration of the 'get_prompt' MCP tool including name, description, and inputSchema.
    {
      name: 'get_prompt',
      description: 'šŸ“– Get Full Prompt: Retrieve a specific prompt by its exact name. āš ļø IMPORTANT: Use search_prompts first to find the correct prompt name, then use this tool. Returns the complete prompt content with metadata and template variables.',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Exact prompt name from search results. Must match exactly (e.g., "api_documentation_generator", "REST API Endpoint Generator"). Copy the name field from search_prompts results.',
          },
        },
        required: ['name'],
        examples: [
          { name: "software_project_build_plan_generator", description: "Get the build plan generator prompt" },
          { name: "youtube_metadata_generator", description: "Get the YouTube metadata prompt" }
        ],
      },
    },
  • The handler function that implements the logic for the 'get_prompt' tool: retrieves the prompt from cache, handles errors with suggestions, and formats the response.
    private handleGetPrompt(args: EnhancedToolArguments): CallToolResult {
      if (!args.name) {
        throw new Error('Prompt name is required. šŸ’” TIP: Use search_prompts first to find the exact prompt name, then use that name here.');
      }
      
      const prompt = this.cache.getPrompt(args.name);
      if (!prompt) {
        // Suggest similar prompts
        const allPrompts = this.cache.getAllPrompts();
        const searchTerm = args.name.toLowerCase();
        const similarPrompts = allPrompts
          .filter(p => p.name.toLowerCase().includes(searchTerm) || 
                      p.metadata.title?.toLowerCase().includes(searchTerm))
          .slice(0, 3)
          .map(p => `- ${p.name} (${p.metadata.title})`)
          .join('\n');
        
        const suggestion = similarPrompts ? 
          `\n\nšŸ’” Did you mean one of these?\n${similarPrompts}\n\nšŸ” Use search_prompts to find the exact name.` :
          '\n\nšŸ” Use search_prompts to find available prompt names.';
          
        throw new Error(`Prompt "${args.name}" not found.${suggestion}`);
      }
      
      const text = `# ${prompt.metadata.title || prompt.name}\n\n` +
        `**Name:** ${prompt.name}\n` +
        `**Category:** ${prompt.metadata.category || 'uncategorized'}\n` +
        `**Tags:** ${prompt.metadata.tags?.join(', ') || 'none'}\n` +
        `**Description:** ${prompt.metadata.description || 'No description'}\n` +
        `**Author:** ${prompt.metadata.author || 'Unknown'}\n` +
        `**Difficulty:** ${prompt.metadata.difficulty || 'intermediate'}\n\n` +
        `## Content:\n\n${prompt.content}`;
      
      return {
        content: [
          {
            type: 'text',
            text,
          } as TextContent,
        ],
      };
    }
  • Helper method in PromptCache that retrieves a specific prompt by name from the internal cache map.
    getPrompt(name: string): PromptInfo | undefined {
      return this.cache.get(name);
    }
  • Tool dispatch in handleToolCall switch statement that routes 'get_prompt' calls to the handler.
    case 'get_prompt':
      return this.handleGetPrompt(toolArgs);
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes the return value ('complete prompt content with metadata and template variables') and includes a caution note ('āš ļø IMPORTANT') about the exact name requirement, adding useful context beyond basic functionality. However, it doesn't mention potential errors or rate limits.

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?

The description is front-loaded with the core purpose, followed by important usage guidance and return details. Every sentence adds value with no wasted words, and the emoji and formatting enhance readability without sacrificing clarity.

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?

For a simple retrieval tool with one well-documented parameter and no output schema, the description is largely complete. It explains the purpose, usage workflow, and return content. The main gap is the lack of error handling or edge case information, but overall it provides sufficient context for effective use.

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 parameter thoroughly. The description reinforces the 'exact name' requirement and references 'search_prompts results,' adding some context but not significant new semantic information beyond what the schema provides.

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 verb ('Retrieve') and resource ('a specific prompt by its exact name'), making the purpose specific and actionable. It distinguishes from sibling tools like 'search_prompts' by focusing on retrieval of a single prompt rather than searching or listing.

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 explicitly provides usage guidance: 'Use search_prompts first to find the correct prompt name, then use this tool.' This specifies a clear workflow and alternative tool, helping the agent understand when and how to use this tool effectively.

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/jezweb/smart-prompts-mcp'

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