refactor: swap server names in mcp_settings.json and enhance comments in mcpService.ts and index.ts for clarity

This commit is contained in:
samanhappy
2025-04-04 00:00:43 +08:00
parent 98f9875ccc
commit 4ab7ad28e0
3 changed files with 35 additions and 27 deletions

View File

@@ -209,6 +209,8 @@ export const createMcpServer = (name: string, version: string): McpServer => {
return new McpServer({ name, version });
};
// Optimized comments to focus on key details and removed redundant explanations
// Helper function: Convert JSON Schema to Zod Schema
function cast(inputSchema: unknown): ZodRawShape {
if (typeof inputSchema !== 'object' || inputSchema === null) {
@@ -250,7 +252,7 @@ function cast(inputSchema: unknown): ZodRawShape {
}
if (prop.description) {
zodType = zodType.describe(prop.description);
zodType = zodType.describe(prop.description); // Add description to the schema
}
processedSchema[key] = zodType.optional();