selected_records
Retrieve details about records currently highlighted in DEVONthink to access document information without manual searching.
Instructions
Get information about currently selected records in DEVONthink.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The handler function for the 'selected_records' tool. It executes a JXA script to fetch records currently selected in the DEVONthink application and returns their summaries.
export const selectedRecordsTool = defineTool({ name: "selected_records", description: "Get information about currently selected records in DEVONthink.", schema: z.object({}), run: async (_args, executor) => { const script = ` ${JXA_APP} var records = app.selectedRecords(); var result = []; for (var i = 0; i < records.length; i++) { var record = records[i]; result.push(${JXA_RECORD_SUMMARY}); } JSON.stringify(result); `.trim(); const { stdout } = executor.run(script); return JSON.parse(stdout) as Array<{ uuid: string; name: string; type: string; location: string; database: string; tags: string[]; score: number; flagged: boolean; label: number; modificationDate: string | null; }>; }, }); - src/tools/index.ts:76-76 (registration)The registration of the 'selectedRecordsTool' in the 'allTools' array.
selectedRecordsTool,