/** * Feedback for tool calls the model gets wrong. * * A tool whose arguments fail schema validation is rejected by LangChain BEFORE * the tool's own code runs, so the model receives the generic * "Received tool input did not match expected schema" and has nothing to act * on. Small models respond by re-emitting the identical call until the * iteration budget is gone — one observed run burned 14 of 15 iterations and * 108k input tokens repeating a `read_entity` call that was missing `type`. * * These helpers replace that dead end with the same imperative phrasing the * graph tools already use for their own errors, and give the caller a way to * detect a call that is looping. */ /** Identical failing calls tolerated before the tool loop is abandoned. */ export declare const REPEATED_TOOL_FAILURE_LIMIT = 3; /** * Stable identity for a tool call. Models re-emit the same arguments with the * keys in a different order — `{id, include}` one iteration, `{include, id}` * the next — so the signature must be key-order independent or a loop reads as * a series of distinct calls. */ export declare function toolCallSignature(name: string, args: unknown): string; /** * Explain, in the tool's own terms, why its arguments were rejected. Returns * null when the schema cannot be introspected or the arguments actually * validate — in both cases the caller should fall back to the raw error, since * the rejection came from somewhere else. */ export declare function describeToolInputRejection(params: { toolName: string; schema: unknown; args: unknown; }): string | null; /** Final word to the model when the same rejected call keeps coming back. */ export declare function repeatedToolFailureMessage(params: { toolName: string; attempts: number; }): string; //# sourceMappingURL=tool-error-feedback.d.ts.map