(input: {
readonly endpoint: string;
readonly pool: ReturnType<typeof createMcpConnectionPool>;
readonly toolName: string;
readonly args: Record<string, unknown>;
readonly elicit?: Elicit;
})
| 11 | Effect.succeed(ElicitationResponse.make({ action: "accept", content: { approved: true } })); |
| 12 | |
| 13 | const invoke = (input: { |
| 14 | readonly endpoint: string; |
| 15 | readonly pool: ReturnType<typeof createMcpConnectionPool>; |
| 16 | readonly toolName: string; |
| 17 | readonly args: Record<string, unknown>; |
| 18 | readonly elicit?: Elicit; |
| 19 | }) => |
| 20 | invokeMcpTool({ |
| 21 | toolId: input.toolName, |
| 22 | toolName: input.toolName, |
| 23 | args: input.args, |
| 24 | transport: "streamable-http", |
| 25 | connector: createMcpConnector({ |
| 26 | transport: "remote", |
| 27 | endpoint: input.endpoint, |
| 28 | remoteTransport: "streamable-http", |
| 29 | }), |
| 30 | connectionPool: input.pool, |
| 31 | connectionPoolKey: input.endpoint, |
| 32 | elicit: input.elicit ?? acceptAll, |
| 33 | }); |
| 34 | |
| 35 | describe("MCP connection pool", () => { |
| 36 | it.effect("reuses one session for sequential invokes", () => |
no test coverage detected