| 124 | } |
| 125 | |
| 126 | export function listMCPTools( |
| 127 | clientId: string, |
| 128 | ...args: Parameters<typeof Client.prototype.listTools> |
| 129 | ): ReturnType<typeof Client.prototype.listTools> { |
| 130 | const client = runningClients[clientId] |
| 131 | if (!client) { |
| 132 | throw new Error(`listTools: client not found with id: ${clientId}`) |
| 133 | } |
| 134 | if (!listToolsCache[clientId]) { |
| 135 | listToolsCache[clientId] = client.listTools(...args) |
| 136 | } |
| 137 | return listToolsCache[clientId] |
| 138 | } |
| 139 | |
| 140 | function getResourceData( |
| 141 | resource: TextResourceContents | BlobResourceContents, |