* Build the search result output structure.
( matches: string[], query: string, totalDeferredTools: number, pendingMcpServers?: string[], )
| 108 | * Build the search result output structure. |
| 109 | */ |
| 110 | function buildSearchResult( |
| 111 | matches: string[], |
| 112 | query: string, |
| 113 | totalDeferredTools: number, |
| 114 | pendingMcpServers?: string[], |
| 115 | ): { data: Output } { |
| 116 | return { |
| 117 | data: { |
| 118 | matches, |
| 119 | query, |
| 120 | total_deferred_tools: totalDeferredTools, |
| 121 | ...(pendingMcpServers && pendingMcpServers.length > 0 |
| 122 | ? { pending_mcp_servers: pendingMcpServers } |
| 123 | : {}), |
| 124 | }, |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Parse tool name into searchable parts. |