UNPKG

@andrea9293/mcp-gemini-prompt-enhancer

Version:

A Model Context Protocol (MCP) server that provides a prompt optimization service for Large Language Models (LLMs) using Google Gemini, with advanced prompt engineering thanks to 22365_3_Prompt_Engineering_v7.pdf authored by Lee Boonstra

35 lines (34 loc) 1.18 kB
import { z } from "zod"; import * as services from "./services/index.js"; /** * Register all tools with the MCP server * * @param server The FastMCP server instance */ export function registerTools(server) { server.addTool({ name: "enhance_prompt", description: "A tool to enhance prompts", parameters: z.object({ prompt: z.string().describe("The prompt to enhance") }), execute: async (params) => { const enhanced = await services.PromptEnhancerService.enhancePrompt(params.prompt, ""); return enhanced; } }); } export function registerRemoteTools(server) { server.addTool({ name: "enhance_prompt", description: "A tool to enhance prompts", parameters: z.object({ prompt: z.string().describe("The prompt to enhance") }), execute: async (params, context) => { const apiKey = context.session && context.session.geminiApiKey ? context.session.geminiApiKey : ""; const enhanced = await services.PromptEnhancerService.enhancePrompt(params.prompt, apiKey); return enhanced; } }); }