get_open_databases
Lists currently open databases in DEVONthink to help users track and manage active database sessions for document organization and access.
Instructions
Get a list of all currently open databases in DEVONthink.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The get_open_databases tool handler definition and implementation using JXA to interact with DEVONthink.
export const getOpenDatabasesTool = defineTool({ name: "get_open_databases", description: "Get a list of all currently open databases in DEVONthink.", schema: z.object({}), run: async (_args, executor) => { const script = ` ${JXA_APP} var dbs = app.databases(); var result = []; for (var i = 0; i < dbs.length; i++) { var db = dbs[i]; result.push({ uuid: db.uuid(), name: db.name(), path: db.path() }); } JSON.stringify(result); `.trim(); const { stdout } = executor.run(script); return JSON.parse(stdout) as Array<{ uuid: string; name: string; path: string; }>; }, });