initial commit

This commit is contained in:
azykov@mail.ru
2026-07-01 10:34:30 +03:00
commit 5e234d9d61
16 changed files with 3032 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import z from "zod";
import { zodToJsonSchema } from "zod-to-json-schema";
import { server } from "../server";
import { ToolDef } from "../types";
import { logged } from "../utils/logged";
export const listToolsTool: ToolDef = {
title: "list_tools",
config: {
description: "Return the authoritative current list of available local tools with their schemas.",
inputSchema: {},
},
handler: logged('list_tools', async () => ({
content: [{
type: "text",
text: JSON.stringify(
Object.values(server.tools)
.map((tool) => ({
...tool,
config: {
...tool.config,
inputSchema: zodToJsonSchema(z.object(tool.config.inputSchema), { target: "jsonSchema7" }),
}
})),
null,
2,
)
}],
})),
}