()
| 128 | } |
| 129 | |
| 130 | async execute(): Promise<ToolResult> { |
| 131 | const functionCalls: FunctionCall[] = [ |
| 132 | { |
| 133 | name: this.serverToolName, |
| 134 | args: this.params, |
| 135 | }, |
| 136 | ]; |
| 137 | |
| 138 | const rawResponseParts = await this.mcpTool.callTool(functionCalls); |
| 139 | |
| 140 | // Ensure the response is not an error |
| 141 | if (this.isMCPToolError(rawResponseParts)) { |
| 142 | throw new Error( |
| 143 | `MCP tool '${this.serverToolName}' reported tool error with response: ${JSON.stringify(rawResponseParts)}`, |
| 144 | ); |
| 145 | } |
| 146 | |
| 147 | const transformedParts = transformMcpContentToParts(rawResponseParts); |
| 148 | |
| 149 | return { |
| 150 | llmContent: transformedParts, |
| 151 | returnDisplay: getStringifiedResultForDisplay(rawResponseParts), |
| 152 | }; |
| 153 | } |
| 154 | |
| 155 | getDescription(): string { |
| 156 | return this.displayName; |
nothing calls this directly
no test coverage detected