Skip to main content
Glama
lumile

Promptopia MCP

by lumile

add_multi_message_prompt

Create structured prompts with role-based messages for AI interactions. Define user and assistant messages with text or image content to build multi-turn conversation templates.

Instructions

Adds a new multi-message prompt with role-based messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the prompt
descriptionNoDescription of the prompt
messagesYesArray of messages with roles

Implementation Reference

  • Handler logic for the 'add_multi_message_prompt' tool: extracts arguments from input, calls PromptsService.addMultiMessagePrompt, and returns JSON stringified result as text content.
    case 'add_multi_message_prompt': {
      const { name, description, messages } = args
      const result = await this.promptsService.addMultiMessagePrompt({
        name,
        description,
        messages
      })
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      }
    }
  • Tool registration in listTools(): defines name, description, and detailed inputSchema for 'add_multi_message_prompt'.
    {
      name: 'add_multi_message_prompt',
      description: 'Adds a new multi-message prompt with role-based messages',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the prompt'
          },
          description: {
            type: 'string',
            description: 'Description of the prompt'
          },
          messages: {
            type: 'array',
            description: 'Array of messages with roles',
            items: {
              type: 'object',
              properties: {
                role: {
                  type: 'string',
                  enum: ['user', 'assistant'],
                  description: 'Role of the message sender'
                },
                content: {
                  type: 'object',
                  properties: {
                    type: {
                      type: 'string',
                      enum: ['text', 'image'],
                      description: 'Type of content'
                    },
                    text: {
                      type: 'string',
                      description: 'Text content (required for text type)'
                    },
                    image: {
                      type: 'string',
                      description: 'Image data (required for image type)'
                    }
                  },
                  required: ['type']
                }
              },
              required: ['role', 'content']
            }
          }
        },
        required: ['name', 'messages']
      }
    }
  • TypeScript interface defining the input parameters for addMultiMessagePrompt: name (required), optional description, and array of messages.
    export interface AddMultiMessagePromptParams {
      name: string
      description?: string
      messages: PromptMessage[]
    }
  • Core service method: validates parameters, generates unique ID, extracts variables from messages, constructs MultiMessagePrompt object, persists to JSON file in prompts directory, returns the created prompt.
    async addMultiMessagePrompt(params: AddMultiMessagePromptParams): Promise<MultiMessagePrompt> {
      if (!params.name || !params.name.trim()) {
        throw new ValidationError('Prompt name is required')
      }
    
      if (!params.messages || !Array.isArray(params.messages) || params.messages.length === 0) {
        throw new ValidationError('At least one message is required')
      }
    
      if (!PromptValidationUtils.validateMessages(params.messages)) {
        throw new ValidationError('Invalid message structure')
      }
    
      const id = `prompt-${uuidv4().slice(0, 8)}`
      const variables = this.extractVariablesFromMessages(params.messages)
    
      const prompt: MultiMessagePrompt = {
        id,
        name: params.name.trim(),
        description: params.description?.trim() || '',
        variables,
        createdAt: new Date().toISOString(),
        version: '2.0',
        messages: params.messages
      }
    
      try {
        await this.fileSystemService.writeJSONFile(
          path.join(this.promptsDir, `${id}.json`),
          prompt
        )
        return prompt
      } catch (error) {
        console.error('Failed to save multi-message prompt:', error)
        throw error
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states it 'adds a new' prompt, implying a creation/mutation operation, but doesn't disclose behavioral traits such as permissions needed, whether it's idempotent, error handling, or what happens on success (e.g., returns a prompt ID). This is a significant gap for a mutation tool with zero annotation coverage.

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 (role-based messages). There is zero waste, making it easy to parse and understand quickly.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., a prompt ID or confirmation), error conditions, or interaction with sibling tools. Given the complexity of nested message structures and multiple siblings, more context is needed 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 fully documents parameters like 'name', 'description', and 'messages' with details on roles and content types. The description adds no additional meaning beyond implying role-based messages, which is already covered in the schema. Baseline 3 is appropriate as 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 action ('adds') and resource ('multi-message prompt'), specifying it creates a new prompt with role-based messages. It distinguishes from simpler 'add_prompt' by highlighting the multi-message aspect, though it doesn't explicitly contrast with all siblings like 'apply_prompt' or 'update_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 is provided on when to use this tool versus alternatives. With siblings like 'add_prompt', 'apply_prompt', and 'update_prompt', the description lacks context on use cases, prerequisites, or distinctions, leaving the agent to infer based on tool names alone.

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/lumile/promptopia-mcp'

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