Skip to main content
Glama
lumile

Promptopia MCP

by lumile

get_prompt

Retrieve a specific prompt by its unique ID using the Promptopia MCP server for quick and precise access to stored prompts.

Instructions

Gets a prompt by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the prompt to retrieve

Implementation Reference

  • Tool execution handler in callTool method: extracts 'id' from arguments, retrieves prompt via service, returns JSON-formatted result as MCP content.
    case 'get_prompt': { const { id } = args const result = await this.promptsService.getPrompt(id) return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] } }
  • Tool registration in listTools(): defines name, description, and input schema requiring 'id'.
    { name: 'get_prompt', description: 'Gets a prompt by its ID', inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the prompt to retrieve' } }, required: ['id'] } },
  • Core helper function implementing prompt retrieval: validates id, reads JSON file from prompts directory, handles not found errors.
    async getPrompt(id: string): Promise<Prompt> { if (!id || !id.trim()) { throw new ValidationError('Prompt ID is required') } try { const filePath = path.join(this.promptsDir, `${id}.json`) return await this.fileSystemService.readJSONFile<Prompt>(filePath) } catch (error) { if (error instanceof Error && error.message.includes('not found')) { throw new NotFoundError(`Prompt not found: ${id}`) } throw error } }
  • Input schema definition for the get_prompt tool: object with required 'id' string property.
    inputSchema: { type: 'object', properties: { id: { type: 'string', description: 'ID of the prompt to retrieve' } }, required: ['id'] } },

Other Tools

Related 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