Project Files
src / tools / listTools.ts
import { tool } from "@lmstudio/sdk";
import { z } from "zod";
import { getToolDefinition, getToolList, TOOL_DEFINITIONS } from "../utils/toolRegistry";
const TOOL_DEFINITION = getToolDefinition("list_tools");
export const listToolsTool = tool({
name: TOOL_DEFINITION.name,
description: TOOL_DEFINITION.description,
parameters: {
includeDetails: z.boolean().optional().describe("Whether to include tool descriptions in the result."),
},
implementation: async ({ includeDetails }) => {
const include = includeDetails ?? false;
return {
count: TOOL_DEFINITIONS.length,
includeDetails: include,
tools: getToolList(include),
};
},
});