Skip to main content
Glama
tanker327

Prompts MCP Server

by tanker327

get_prompt

Retrieve prompt templates by name from a markdown-based prompt management system for use in AI applications.

Instructions

Retrieve a prompt by name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the prompt to retrieve

Implementation Reference

  • The primary handler function for the 'get_prompt' tool. Validates the input 'name' parameter and fetches the full prompt content from file operations.
    private async handleGetPrompt(args: ToolArguments): Promise<CallToolResult> {
      if (!args.name) {
        throw new Error('Name is required for get_prompt');
      }
      
      const content = await this.fileOps.readPrompt(args.name);
      return {
        content: [
          {
            type: 'text',
            text: content,
          } as TextContent,
        ],
      };
  • JSON schema defining the input parameters for the get_prompt tool (requires 'name' as string).
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the prompt to retrieve',
        },
      },
      required: ['name'],
  • src/tools.ts:46-57 (registration)
    Registration of the 'get_prompt' tool definition in the list of available tools returned by getToolDefinitions().
    name: 'get_prompt',
    description: 'Retrieve a prompt by name',
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the prompt to retrieve',
        },
      },
      required: ['name'],
    },
  • src/tools.ts:140-141 (registration)
    Routing registration for 'get_prompt' in the handleToolCall switch statement.
    case 'get_prompt':
      return await this.handleGetPrompt(toolArgs);
  • Helper method in PromptFileOperations that reads the full content of the prompt markdown file, used by the get_prompt handler.
    async readPrompt(name: string): Promise<string> {
      const fileName = this.sanitizeFileName(name) + '.md';
      const filePath = path.join(this.promptsDir, fileName);
      try {
        return await fs.readFile(filePath, 'utf-8');
      } catch (error) {
        throw new Error(`Prompt "${name}" not found`);
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Retrieve' implies a read operation, but it doesn't specify permissions needed, error handling (e.g., if the prompt doesn't exist), rate limits, or response format. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action ('retrieve a prompt') and includes the key constraint ('by name'), making it easy to parse quickly. Every word earns its place without redundancy.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'retrieve' entails (e.g., returns prompt content, metadata, or both), error cases, or how it differs behaviorally from siblings. For a tool in a set with multiple prompt-related operations, more context is needed to guide 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?

The schema description coverage is 100%, with the single parameter 'name' fully documented in the schema. The description adds minimal value beyond the schema by implying the parameter is used to identify the prompt, but it doesn't provide additional context like format examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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 clearly states the verb ('retrieve') and resource ('prompt'), specifying it's done 'by name'. It distinguishes from siblings like 'list_prompts' (which retrieves multiple) and 'delete_prompt' (which removes). However, it doesn't explicitly differentiate from 'add_prompt' or 'create_structured_prompt' in terms of retrieval vs. creation, though the verb 'retrieve' implies read-only access.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing prompt), exclusions (e.g., not for creating prompts), or direct comparisons to siblings like 'list_prompts' for browsing all prompts. Usage is implied by the action but not explicitly stated.

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/tanker327/prompts-mcp-server'

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