/** * Tool-name selection, shared by the connectors that load their tools from a * remote MCP server. * * `connectors.mcp` selects by raw tool name across arbitrary servers. A name in * `includeTools`/`excludeTools` that no loaded tool answers to is an error * naming what *was* available, so a typo fails the deployment instead of * silently dropping a tool the agent was meant to have. */ import { z } from "zod"; /** * Tool names to expose or hide from a connector's loaded tools. * * `TTool` stays generic for callers that can narrow tool-name unions. MCP load * and runtime selection keep the default `string`. */ export interface ToolSelection { /** Tool names to expose. Omitted means every loaded tool. */ includeTools?: TTool[]; /** Tool names to hide. Applied after {@link ToolSelection.includeTools}. */ excludeTools?: TTool[]; } /** * Shared authoring options for connectors that load remote tools. */ export interface ToolSelectionConnectorConfig extends ToolSelection { /** Timeout for each tool call (milliseconds on the TypeScript runtime). */ defaultToolTimeout?: number; } /** * Zod args schema for connectors that accept {@link ToolSelectionConnectorConfig}. * * Shared by connector factories so blank/duplicate names and include∩exclude * overlap fail the same way. `extra` adds connector-specific fields. */ export declare function toolSelectionConnectorSchema(extra?: z.ZodRawShape): z.ZodType; /** Read the name a selection matches a loaded tool by. */ export type ToolNameReader = (tool: unknown) => string | undefined; /** Read a loaded tool's own `name`. The default for connectors that don't rename. */ export declare const toolName: ToolNameReader; /** * Apply a selection to loaded tools, rejecting names that matched nothing. * * `subject` names the declaration in error messages, e.g. `MCP server "docs"`. * A tool whose name cannot be read is kept only when the selection is exclusive * (`excludeTools` alone) — an `includeTools` list is an allowlist, and an * unnameable tool is not on it. */ export declare function selectTools(subject: string, selection: ToolSelection, tools: readonly unknown[], readName?: ToolNameReader): unknown[]; //# sourceMappingURL=tool-selection.d.ts.map