codemesh
Version: 
Execute TypeScript code against multiple MCP servers, weaving them together into powerful workflows
48 lines (47 loc) • 1.9 kB
TypeScript
/**
 * Shared utility functions for naming and conversion
 */
/**
 * Convert string to camelCase
 * @example "get_forecast" → "getForecast"
 * @example "weather-server" → "weatherServer"
 */
export declare function toCamelCase(str: string): string;
/**
 * Convert string to PascalCase
 * @example "get_forecast" → "GetForecast"
 * @example "weather-server" → "WeatherServer"
 */
export declare function toPascalCase(str: string): string;
/**
 * Create server object name for namespaced API
 * @example "weather-server" → "weatherServer"
 * @example "geocode-server" → "geocodeServer"
 * @example "filesystem-server" → "filesystemServer"
 */
export declare function createServerObjectName(serverId: string): string;
/**
 * Convert tool name to camelCase method name
 * @example "get_alerts" → "getAlerts"
 * @example "geocode" → "geocode"
 * @example "read_text_file" → "readTextFile"
 */
export declare function convertToolName(toolName: string): string;
/**
 * Convert server ID to proper server name for namespace
 * @example "weather-server" → "WeatherServer"
 * @example "geocode-server" → "GeocodeServer"
 */
export declare function convertServerName(serverId: string): string;
/**
 * Create a safe function name from tool name and server ID
 * Used for backwards compatibility in runtime wrapper
 * @example ("get_forecast", "weather-server") → "get_forecast_weather_server"
 */
export declare function createSafeFunctionName(toolName: string, serverId: string): string;
/**
 * Update tool description to replace snake_case tool names with scoped camelCase versions
 * @example sanitizeToolDescription("Use read_text_file instead", ["read_text_file"], "filesystem-server")
 *          → "Use filesystemServer.readTextFile instead"
 */
export declare function sanitizeToolDescription(description: string, allToolNames: string[], serverObjectName: string): string;