(content: string, format: string | undefined, toolName: string)
| 23 | const JSON_DEFAULT_TOOLS = new Set(['execute_sql', 'get_schema']) |
| 24 | |
| 25 | function applyFormat(content: string, format: string | undefined, toolName: string): string { |
| 26 | const effectiveFormat = format ?? (JSON_DEFAULT_TOOLS.has(toolName) ? 'json' : 'text') |
| 27 | if (effectiveFormat === 'json') return content |
| 28 | |
| 29 | const textResult = formatToolResultAsText(content) |
| 30 | return textResult ?? content |
| 31 | } |
| 32 | |
| 33 | function registerTools(server: McpServer, dbManager: McpDatabaseManager): void { |
| 34 | for (const tool of MCP_TOOL_REGISTRY) { |
no test coverage detected