Skip to content

Commit 583f500

Browse files
chore: add return type annotation for accuracy testing client
1 parent e6f426d commit 583f500

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/accuracy/sdk/accuracy-testing-client.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"
55

66
import { MCP_SERVER_CLI_SCRIPT } from "./constants.js";
77
import { LLMToolCall } from "./accuracy-result-storage/result-storage.js";
8+
import { VercelMCPClient, VercelMCPClientTools } from "./agent.js";
89

910
type ToolResultGeneratorFn = (...parameters: unknown[]) => CallToolResult | Promise<CallToolResult>;
1011
export type MockedTools = Record<string, ToolResultGeneratorFn>;
@@ -22,15 +23,15 @@ export class AccuracyTestingClient {
2223
private mockedTools: MockedTools = {};
2324
private llmToolCalls: LLMToolCall[] = [];
2425

25-
private constructor(private readonly vercelMCPClient: Awaited<ReturnType<typeof createMCPClient>>) {}
26+
private constructor(private readonly vercelMCPClient: VercelMCPClient) {}
2627

27-
async close() {
28+
async close(): Promise<void> {
2829
await this.vercelMCPClient?.close();
2930
}
3031

31-
async vercelTools() {
32+
async vercelTools(): Promise<VercelMCPClientTools> {
3233
const vercelTools = (await this.vercelMCPClient?.tools()) ?? {};
33-
const rewrappedVercelTools: typeof vercelTools = {};
34+
const rewrappedVercelTools: VercelMCPClientTools = {};
3435
for (const [toolName, tool] of Object.entries(vercelTools)) {
3536
rewrappedVercelTools[toolName] = createVercelTool({
3637
...tool,
@@ -65,20 +66,20 @@ export class AccuracyTestingClient {
6566
return rewrappedVercelTools;
6667
}
6768

68-
getLLMToolCalls() {
69+
getLLMToolCalls(): LLMToolCall[] {
6970
return this.llmToolCalls;
7071
}
7172

72-
mockTools(mockedTools: MockedTools) {
73+
mockTools(mockedTools: MockedTools): void {
7374
this.mockedTools = mockedTools;
7475
}
7576

76-
resetForTests() {
77+
resetForTests(): void {
7778
this.mockTools({});
7879
this.llmToolCalls = [];
7980
}
8081

81-
static async initializeClient(mdbConnectionString: string) {
82+
static async initializeClient(mdbConnectionString: string): Promise<AccuracyTestingClient> {
8283
const clientTransport = new StdioClientTransport({
8384
command: process.execPath,
8485
args: [MCP_SERVER_CLI_SCRIPT, "--connectionString", mdbConnectionString],

0 commit comments

Comments
 (0)