Skip to main content
Glama
tanker327

Prompts MCP Server

by tanker327

create_structured_prompt

Build structured prompts with guided metadata for organization and reuse in the Prompts MCP Server.

Instructions

Create a new prompt with guided metadata structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the prompt
titleYesHuman-readable title for the prompt
descriptionYesBrief description of what the prompt does
categoryNoCategory (e.g., development, writing, analysis)
tagsNoArray of tags for categorization
difficultyNoDifficulty level of the prompt
authorNoAuthor of the prompt
contentYesThe actual prompt content (markdown)

Implementation Reference

  • The handler function that executes the create_structured_prompt tool. It validates required arguments, constructs YAML frontmatter metadata from optional and required fields, appends the prompt content, saves the file using fileOps, and returns a success message with key metadata.
      private async handleCreateStructuredPrompt(args: ToolArguments): Promise<CallToolResult> {
        if (!args.name || !args.content || !args.title || !args.description) {
          throw new Error('Name, content, title, and description are required for create_structured_prompt');
        }
    
        // Build structured frontmatter with provided metadata
        const metadata = {
          title: args.title,
          description: args.description,
          category: args.category || 'general',
          tags: args.tags || ['general'],
          difficulty: args.difficulty || 'beginner',
          author: args.author || 'User',
          version: '1.0',
          created: new Date().toISOString().split('T')[0],
        };
    
        // Create YAML frontmatter
        const frontmatter = `---
    title: "${metadata.title}"
    description: "${metadata.description}"
    category: "${metadata.category}"
    tags: ${JSON.stringify(metadata.tags)}
    difficulty: "${metadata.difficulty}"
    author: "${metadata.author}"
    version: "${metadata.version}"
    created: "${metadata.created}"
    ---
    
    `;
    
        const fullContent = frontmatter + args.content;
        const fileName = await this.fileOps.savePrompt(args.name, fullContent);
        
        return {
          content: [
            {
              type: 'text',
              text: `Structured prompt "${args.name}" created successfully as ${fileName} with metadata:\n- Title: ${metadata.title}\n- Category: ${metadata.category}\n- Tags: ${metadata.tags.join(', ')}\n- Difficulty: ${metadata.difficulty}`,
            } as TextContent,
          ],
        };
      }
  • src/tools.ts:81-124 (registration)
    Tool registration in the getToolDefinitions() method, specifying the name, description, and inputSchema for MCP listTools.
    {
      name: 'create_structured_prompt',
      description: 'Create a new prompt with guided metadata structure',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the prompt',
          },
          title: {
            type: 'string',
            description: 'Human-readable title for the prompt',
          },
          description: {
            type: 'string',
            description: 'Brief description of what the prompt does',
          },
          category: {
            type: 'string',
            description: 'Category (e.g., development, writing, analysis)',
          },
          tags: {
            type: 'array',
            items: { type: 'string' },
            description: 'Array of tags for categorization',
          },
          difficulty: {
            type: 'string',
            enum: ['beginner', 'intermediate', 'advanced'],
            description: 'Difficulty level of the prompt',
          },
          author: {
            type: 'string',
            description: 'Author of the prompt',
          },
          content: {
            type: 'string',
            description: 'The actual prompt content (markdown)',
          },
        },
        required: ['name', 'title', 'description', 'content'],
      },
    },
  • JSON Schema defining the input parameters, required fields, and descriptions for the create_structured_prompt tool.
    inputSchema: {
      type: 'object',
      properties: {
        name: {
          type: 'string',
          description: 'Name of the prompt',
        },
        title: {
          type: 'string',
          description: 'Human-readable title for the prompt',
        },
        description: {
          type: 'string',
          description: 'Brief description of what the prompt does',
        },
        category: {
          type: 'string',
          description: 'Category (e.g., development, writing, analysis)',
        },
        tags: {
          type: 'array',
          items: { type: 'string' },
          description: 'Array of tags for categorization',
        },
        difficulty: {
          type: 'string',
          enum: ['beginner', 'intermediate', 'advanced'],
          description: 'Difficulty level of the prompt',
        },
        author: {
          type: 'string',
          description: 'Author of the prompt',
        },
        content: {
          type: 'string',
          description: 'The actual prompt content (markdown)',
        },
      },
      required: ['name', 'title', 'description', 'content'],
    },
  • src/tools.ts:146-147 (registration)
    Dispatch/registration in the handleToolCall switch statement, routing calls to the specific handler.
    case 'create_structured_prompt':
      return await this.handleCreateStructuredPrompt(toolArgs);
  • TypeScript type definitions in ToolArguments interface for the structured prompt fields.
      // Fields for create_structured_prompt
      title?: string;
      description?: string;
      category?: string;
      tags?: string[];
      difficulty?: 'beginner' | 'intermediate' | 'advanced';
      author?: string;
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states it creates a prompt with metadata. It doesn't disclose behavioral traits such as permissions needed, whether creation is idempotent, error handling, or response format, leaving significant gaps for a mutation tool.

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 that front-loads the core action and key feature ('guided metadata structure'). It avoids redundancy and wastes no words, making it highly concise and well-structured.

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?

For a mutation tool with 8 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavior, error cases, return values, and differentiation from siblings, failing to compensate for the absence of structured metadata.

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 fully documents all 8 parameters. The description adds minimal value by mentioning 'guided metadata structure', which loosely relates to parameters like category and tags, but doesn't provide additional semantics beyond the schema.

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 action ('Create') and resource ('new prompt'), specifying it involves 'guided metadata structure'. It distinguishes from siblings like 'add_prompt' by emphasizing structured metadata, but doesn't explicitly contrast with all siblings (e.g., 'get_prompt').

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?

No guidance on when to use this tool versus alternatives like 'add_prompt' is provided. The description implies creation with metadata, but lacks explicit context, prerequisites, or exclusions for tool selection among siblings.

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