The best way to control Claude Code, Codex and more from any computer or phone

main
ts 23 lines 1.25 KB
Raw
1 import { OrchestratorMcpFailure } from "@t3tools/contracts";
2 import * as Schema from "effect/Schema";
3 import { McpSchema, Tool, Toolkit } from "effect/ai";
4
5 import * as McpInvocationContext from "../../McpInvocationContext.ts";
6 import * as McpToolExposure from "../../McpToolExposure.ts";
7
8 const 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 .annotate(McpSchema.EnabledWhen, McpInvocationContext.hiddenFromOutsideClients);
22
23 export const ToolSearchToolkit = Toolkit.make(ToolSearchTool);