refactor: unify tool reason requirements

This commit is contained in:
2026-10-28 16:43:04 +08:00
parent 7d47a2df86
commit c3050b602b
20 changed files with 97 additions and 46 deletions
+10
View File
@@ -0,0 +1,10 @@
import { tool } from "./tool.js";
// One field and format for optional purpose and required business justification.
export const toolReason = tool.schema.string().trim().min(1).max(2000);
export const optionalToolReason = toolReason.optional().describe(
"Optional reason: one concise sentence explaining the specific purpose. Omit when the command already makes it clear.",
);
export const learningToolReason = toolReason.optional().describe(
"Reason: one concise sentence explaining the durable value or change basis. Required for every write, update or removal; optional for list.",
);