/** * Checks a tool call's arguments against the schema that tool publishes. * * Both checks read the SAME tool definitions the server hands to callers, so * neither can drift from what a caller sees in `tools/list`. They live here * rather than in server/index.ts because that module starts a server the * moment it is imported, which makes its internals untestable. */ /** The shape this module needs from a tool definition; anything else is ignored. */ export interface ToolDefinitionLike { name: string; inputSchema?: { required?: string[]; properties?: Record; }; } export interface ToolArgumentChecker { /** Throws when a field the tool advertises as required is absent. */ assertRequiredFields(name: string, args: unknown): void; /** Throws when a field the tool does not advertise is present. */ assertKnownFields(name: string, args: unknown): void; } /** * The advertised field closest to `candidate`, or null when nothing is close. * * A containing name wins outright -- `filePattern` against `pattern` is a * likelier slip than anything edit distance would rank first. */ export declare function nearestKnownField(candidate: string, known: ReadonlySet): string | null; /** * Builds the two checks from the definitions the server publishes. */ export declare function createToolArgumentChecker(tools: readonly ToolDefinitionLike[]): ToolArgumentChecker; //# sourceMappingURL=tool-arguments.d.ts.map