Skip to main content
Glama
tanker327

Prompts MCP Server

by tanker327

list_prompts

Display available prompt templates to help users find and select pre-configured prompts for their AI workflows.

Instructions

List all available prompts

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for the 'list_prompts' tool. Fetches prompts from file operations, handles empty list, formats the list, and returns as MCP CallToolResult.
    private async handleListPrompts(): Promise<CallToolResult> {
      const prompts = await this.fileOps.listPrompts();
      
      if (prompts.length === 0) {
        return {
          content: [
            {
              type: 'text',
              text: 'No prompts available',
            } as TextContent,
          ],
        };
      }
    
      const text = this.formatPromptsList(prompts);
      
      return {
        content: [
          {
            type: 'text',
            text,
          } as TextContent,
        ],
      };
    }
  • Tool schema definition including name, description, and empty input schema (no parameters required).
    {
      name: 'list_prompts',
      description: 'List all available prompts',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Core helper function that lists all prompts by initializing and querying the prompt cache.
    async listPrompts(): Promise<PromptInfo[]> {
      // Initialize cache and file watcher if not already done
      if (this.cache.isEmpty()) {
        await this.cache.initializeCache();
        this.cache.initializeFileWatcher();
      }
      
      return this.cache.getAllPrompts();
    }
  • src/tools.ts:142-143 (registration)
    Tool registration in the switch dispatcher within handleToolCall method.
    case 'list_prompts':
      return await this.handleListPrompts();
  • Helper function to format the list of prompts into a readable markdown display.
    private formatPromptsList(prompts: PromptInfo[]): string {
      const formatPrompt = (prompt: PromptInfo): string => {
        let output = `## ${prompt.name}\n`;
        
        if (Object.keys(prompt.metadata).length > 0) {
          output += '**Metadata:**\n';
          Object.entries(prompt.metadata).forEach(([key, value]) => {
            output += `- ${key}: ${value}\n`;
          });
          output += '\n';
        }
        
        output += `**Preview:** ${prompt.preview}\n`;
        return output;
      };
    
      return `# Available Prompts\n\n${prompts.map(formatPrompt).join('\n---\n\n')}`;
    }
Behavior2/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 only states the action ('List all available prompts') without mentioning critical details like whether this is a read-only operation, if it requires specific permissions, how results are returned (e.g., pagination), or any rate limits. This leaves significant gaps for an agent to understand the tool's 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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy for an agent to parse quickly. Every word earns its place by directly conveying the tool's purpose.

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 tool's simplicity (0 parameters, no output schema), the description is minimal but adequate for basic understanding. However, with no annotations and no output schema, it lacks context about behavioral traits (e.g., safety, return format) and doesn't differentiate from siblings, making it incomplete for optimal agent usage in a multi-tool environment.

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?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't mention parameters, which is efficient and avoids redundancy. A baseline of 4 is justified as the description doesn't need to compensate for any schema gaps.

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 ('List') and resource ('all available prompts'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_prompt' (which likely retrieves a specific prompt), leaving room for confusion about when to use each.

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 like 'get_prompt' or 'add_prompt'. It lacks context about prerequisites, such as whether authentication is needed or if there are any filtering options, which could help the agent choose appropriately.

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