/** * Discovery tool mode (--tool-mode discovery / TOOL_MODE=discovery). * * Listing ~350 tools with full JSON schemas costs a client tens of thousands * of tokens before the first question. In discovery mode the server lists * only find_tools, call_tool, code_mode and clear_cache. The model searches * with find_tools, which returns names, descriptions and input schemas, and * runs a tool with call_tool. Calls go through the tool registry, so * arguments get the same validation and defaults as a direct call. */ import { z } from "zod"; import type { ApiModule } from "../shared/types.js"; import type { ToolRegistry } from "./tool-registry.js"; export interface ToolMatch { name: string; module: string; title?: string; description: string; inputSchema: unknown; /** Set when the query was a deprecated name for this tool. */ note?: string; } /** Rank registered tools against a free-text query (and optional module filter). */ export declare function findTools(registry: ToolRegistry, modules: ApiModule[], query: string, opts?: { module?: string; limit?: number; }): ToolMatch[]; /** The find_tools and call_tool definitions for discovery mode. */ export declare function discoveryTools(registry: ToolRegistry, modules: ApiModule[]): ({ name: string; description: string; annotations: { title: string; readOnlyHint: boolean; idempotentHint: boolean; openWorldHint: boolean; destructiveHint: boolean; }; parameters: z.ZodObject<{ query: z.ZodDefault; module: z.ZodOptional; limit: z.ZodDefault; }, z.core.$strip>; execute: ({ query, module, limit }: { query: string; module?: string; limit: number; }) => Promise; } | { name: string; description: string; annotations: { title: string; readOnlyHint: boolean; idempotentHint: boolean; openWorldHint: boolean; destructiveHint: boolean; }; parameters: z.ZodObject<{ name: z.ZodString; arguments: z.ZodDefault>; }, z.core.$strip>; execute: ({ name, arguments: args }: { name: string; arguments: Record; }, context?: unknown) => Promise; })[]; //# sourceMappingURL=discovery.d.ts.map