import { ToolReponse } from "../src/tools/response/types";
import { createTestClient } from "./e2e/MCPTestClient";
interface Tool {
name: string;
[key: string]: unknown;
}
describe("testAllTools Real Execution", () => {
test(`should execute real tool: achievement`, async () => {
await testSingleTool("achievement");
}, 120000);
test(`should execute real tool: ammo`, async () => {
await testSingleTool("ammo");
}, 120000);
test(`should execute real tool: armor-materials`, async () => {
await testSingleTool("armor-materials");
}, 120000);
test(`should execute real tool: barter`, async () => {
await testSingleTool("barter");
}, 120000);
test(`should execute real tool: bosses`, async () => {
await testSingleTool("bosses");
}, 120000);
test(`should execute real tool: crafts`, async () => {
await testSingleTool("crafts");
}, 120000);
test(`should execute real tool: hideout-stations`, async () => {
await testSingleTool("hideout-stations");
}, 120000);
test(`should execute real tool: items`, async () => {
await testSingleTool("items");
}, 120000);
test(`should execute real tool: loot-containers`, async () => {
await testSingleTool("loot-containers");
}, 120000);
test(`should execute real tool: maps`, async () => {
await testSingleTool("maps");
}, 120000);
test(`should execute real tool: mastering`, async () => {
await testSingleTool("mastering");
}, 120000);
test(`should execute real tool: player-levels`, async () => {
await testSingleTool("player-levels");
}, 120000);
test(`should execute real tool: quest-items`, async () => {
await testSingleTool("quest-items");
}, 120000);
test(`should execute real tool: server-status`, async () => {
await testSingleTool("server-status");
}, 120000);
test(`should execute real tool: skills`, async () => {
await testSingleTool("skills");
}, 120000);
test(`should execute real tool: stationary-weapons`, async () => {
await testSingleTool("stationary-weapons");
}, 120000);
test(`should execute real tool: tasks`, async () => {
await testSingleTool("tasks");
}, 120000);
test(`should execute real tool: traders`, async () => {
await testSingleTool("traders");
}, 120000);
});
const testSingleTool = async (toolName: string) => {
const client = await createTestClient();
try {
const clientTools = (await client.listTools()) as Tool[];
const tool = clientTools.find((t: Tool) => t.name === toolName);
expect(tool).toBeDefined();
const result = (await client.callTool(toolName)) as ToolReponse;
expect(result).toBeDefined();
expect(result.content).toBeDefined();
expect(result.content.length).toBeGreaterThan(0);
expect(
result.content[0].text.startsWith("This tool returns an error"),
).toBeFalsy();
} finally {
await client.close();
}
};