Skip to main content
Glama
lumile

Promptopia MCP

by lumile

add_prompt

Add new prompts to Promptopia MCP by specifying name, content with variables, and optional description for system integration.

Instructions

Adds a new prompt to the system (single content format)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName of the prompt
contentYesContent of the prompt with variables in {{variable}} format
descriptionNoDescription of the prompt

Implementation Reference

  • Executes the 'add_prompt' tool by destructuring arguments, calling promptsService.addPrompt, and returning the result as MCP content.
    case 'add_prompt': {
      const { name, content, description } = args
      const result = await this.promptsService.addPrompt({ name, content, description })
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      }
    }
  • Registers the 'add_prompt' MCP tool with its name, description, and input schema in the listTools method.
    {
      name: 'add_prompt',
      description: 'Adds a new prompt to the system (single content format)',
      inputSchema: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            description: 'Name of the prompt'
          },
          content: {
            type: 'string',
            description: 'Content of the prompt with variables in {{variable}} format'
          },
          description: {
            type: 'string',
            description: 'Description of the prompt'
          }
        },
        required: ['name', 'content']
      }
    },
  • Defines the TypeScript interface AddPromptParams matching the tool's input schema for type safety.
    export interface AddPromptParams {
      name: string
      content: string
      description?: string
    }
  • Core implementation of adding a prompt: validates params, generates ID and variables, creates SingleContentPrompt, and persists to filesystem.
    async addPrompt(params: AddPromptParams): Promise<Prompt> {
      if (!params.name || !params.name.trim()) {
        throw new ValidationError('Prompt name is required')
      }
    
      if (!params.content || !params.content.trim()) {
        throw new ValidationError('Prompt content is required')
      }
    
      const id = `prompt-${uuidv4().slice(0, 8)}`
      const variables = this.extractVariables(params.content)
    
      const now = new Date().toISOString()
      const prompt: SingleContentPrompt = {
        id,
        name: params.name.trim(),
        content: params.content,
        description: params.description?.trim() || '',
        variables,
        createdAt: now,
        updatedAt: now
      }
    
      try {
        await this.fileSystemService.writeJSONFile(
          path.join(this.promptsDir, `${id}.json`),
          prompt
        )
        return prompt
      } catch (error) {
        console.error('Failed to save 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 the full burden. It states this is an 'Adds' operation (implying creation/mutation) but doesn't disclose behavioral traits like required permissions, whether prompts are unique, error conditions, or what happens on success. The mention of 'single content format' adds minimal context about input constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/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. It could be slightly more informative but avoids unnecessary words, making it appropriately concise for a basic tool definition.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns, error handling, or how it interacts with sibling tools. For a mutation tool in a system with multiple prompt-related tools, 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?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional meaning about parameters beyond implying 'single content format' relates to the 'content' field, but this is vague and doesn't enhance understanding beyond the schema's details on variable formatting.

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 ('Adds') and resource ('a new prompt'), specifying it's for a 'single content format'. This distinguishes it from 'add_multi_message_prompt' which likely handles multiple messages. However, it doesn't explicitly mention what distinguishes it from 'update_prompt' or other siblings beyond format.

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 'add_multi_message_prompt', 'update_prompt', or 'apply_prompt'. It mentions 'single content format' but doesn't explain when that format is appropriate or what the alternatives are.

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