Open History to see the last commit
1import { OrchestratorMcpFailure } from "@t3tools/contracts";
2import * as Schema from "effect/Schema";
3import { Tool, Toolkit } from "effect/ai";
4
5import * as McpInvocationContext from "../../McpInvocationContext.ts";
6import * as McpToolExposure from "../../McpToolExposure.ts";
7
8const ToolSearchTool = Tool.make(McpToolExposure.TOOL_SEARCH, {
9 description:
10 "Load T3 Code tools you do not have yet, then call them by name. Search by name or purpose: threads (t3_thread_*), projects (t3_project_*), worktrees, preview_* browser, device_*, html_preview/html_render, schedule_task, pull requests and guides, attachments, request_secret, environment links. Exact names work too.",
11 parameters: Schema.Struct({ query: Schema.String.check(Schema.isMaxLength(500)) }),
12 success: Schema.Struct({
13 tools: Schema.Array(Schema.Struct({ name: Schema.String, description: Schema.String })),
14 }),
15 failure: OrchestratorMcpFailure,
16 failureMode: "return",
17 dependencies: [McpInvocationContext.McpInvocationContext, McpToolExposure.McpToolExposure],
18})
19 .annotate(Tool.Readonly, true)
20 .annotate(Tool.Destructive, false);
21
22export const ToolSearchToolkit = Toolkit.make(ToolSearchTool);