@toolplex/client
Version:
The official ToolPlex client for AI agent tool discovery and execution
74 lines (73 loc) • 1.87 kB
JavaScript
import { z } from "zod";
// --------------------
// initialize
// --------------------
export const InitializeResultSchema = z.object({
succeeded: z.array(z.object({
server_id: z.string(),
server_name: z.string(),
description: z.string(),
})),
failures: z.record(z.object({
server_id: z.string(),
server_name: z.string(),
error: z.string(),
})),
});
// --------------------
// Install
// --------------------
export const ServerInstallResultSchema = z.object({
server_id: z.string(),
server_name: z.string(),
});
// --------------------
// Uninstall
// --------------------
export const ServerUninstallResultSchema = z.object({
server_id: z.string(),
server_name: z.string(),
});
// --------------------
// list_servers
// --------------------
export const ListServersResultSchema = z.object({
servers: z.array(z.object({
server_id: z.string(),
server_name: z.string(),
description: z.string(),
tool_count: z.number(),
})),
});
// --------------------
// list_tools
// --------------------
export const ListToolsResultSchema = z.object({
server_id: z.string(),
server_name: z.string(),
tools: z.array(z.object({
name: z.string(),
description: z.string().optional(),
inputSchema: z.any(),
})),
});
// --------------------
// list_all_tools
// --------------------
export const ListAllToolsResultSchema = z.object({
tools: z.record(z.array(z.object({
name: z.string(),
description: z.string().optional(),
inputSchema: z.any(),
}))),
});
// --------------------
// call_tool
// --------------------
export const CallToolResultSchema = z.object({
result: z.any(),
});
// --------------------
// cleanup
// --------------------
export const CleanupResultSchema = z.object({});