UNPKG

@skyramp/mcp

Version:

Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution

57 lines (52 loc) 2.33 kB
import { z } from "zod"; import { ModularizationService, } from "../services/ModularizationService.js"; import { logger } from "../utils/logger.js"; const modularizationSchema = { prompt: z .string() .describe("The prompt or code content to process with modularization principles applied"), includeModularization: z .boolean() .optional() .default(true) .describe("Whether to include detailed modularization instructions in the response"), contextType: z .enum(["general", "technical", "creative"]) .optional() .default("general") .describe("The type of context for processing: general for standard content, technical for code/technical content, creative for creative/artistic content"), }; export function registerModularizationTool(server) { server.registerTool("skyramp_modularization", { description: `Process prompts and content using MCP modularization principles. This tool applies modularization principles to structure and organize content, code, or responses in a logical, maintainable way. It's particularly useful for: • Code refactoring with modularization best practices • Structuring complex responses into logical modules • Applying separation of concerns to content organization • Creating maintainable and readable output structures MODULARIZATION PRINCIPLES: • Logical grouping of related functionality • Clear separation of concerns • Parameterization for flexibility • Preservation of original functionality • Helper function extraction where applicable The tool processes your prompt within the MCP framework and provides structured guidance for modularized responses.`, inputSchema: modularizationSchema, annotations: { keywords: [ "modularization", "code organization", "structure", "refactor", ], }, }, async (params) => { logger.info("Generating modularization", { prompt: params.prompt, contextType: params.contextType, includeModularization: params.includeModularization, }); const service = new ModularizationService(); return await service.processModularizationRequest(params); }); }