check_ai_health
Verify DEVONthink's AI services are operational and functioning correctly to ensure document summarization and classification features work as intended.
Instructions
Check if DEVONthink's AI services are available and working properly.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/ai/check-ai-health.ts:13-47 (handler)The check_ai_health tool definition, including the name, description, schema, and the run handler that executes a JXA script to probe DEVONthink AI.
export const checkAiHealthTool = defineTool({ name: "check_ai_health", description: "Check if DEVONthink's AI services are available and working properly.", schema: z.object({}), run: async (_args, executor) => { const script = ` ${JXA_APP} var available = false; var message = ""; var model = null; try { // Attempt a lightweight AI probe: ask a trivial question with no documents. // DEVONthink will throw if the AI engine is unavailable or misconfigured. var testAnswer = app.getChatResponseForMessage("Reply with the single word: OK", { temperature: 0 }); available = true; message = "DEVONthink AI is available and responding."; } catch (e) { available = false; message = e.message || String(e); } JSON.stringify({ available: available, message: message, model: model }); `; const result = executor.run(script); return JSON.parse(result.stdout) as { available: boolean; message: string; model: string | null; }; }, });