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; }

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