Skip to main content
Glama

current_database

Retrieve details about the active database in DEVONthink to understand your current workspace context and available resources.

Instructions

Get information about the currently selected database in DEVONthink.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for the `current_database` tool, which executes a JXA script to retrieve the current database details.
    export const currentDatabaseTool = defineTool({
      name: "current_database",
      description:
        "Get information about the currently selected database in DEVONthink.",
      schema: z.object({}),
      run: async (_args, executor) => {
        const script = `
    ${JXA_APP}
    var db = app.currentDatabase();
    if (!db || !db.uuid()) throw new Error("No current database found");
    JSON.stringify({
      uuid: db.uuid(),
      name: db.name(),
      path: db.path()
    });
    `.trim();
    
        const { stdout } = executor.run(script);
        return JSON.parse(stdout) as {
          uuid: string;
          name: string;
          path: string;
        };
      },
    });
  • The `current_database` tool is imported and added to the `allTools` array, which registers all available tools for the MCP server.
    import { currentDatabaseTool } from "./database/get-current-database.js";
    
    // Records
    import { getRecordByIdTool } from "./records/get-record-by-id.js";
    import { getRecordPropertiesTool } from "./records/get-record-properties.js";
    import { getRecordContentTool } from "./records/get-record-content.js";
    import { createRecordTool } from "./records/create-record.js";
    import { deleteRecordTool } from "./records/delete-record.js";
    import { updateRecordContentTool } from "./records/update-record-content.js";
    import { setRecordPropertiesTool } from "./records/set-record-properties.js";
    import { renameRecordTool } from "./records/rename-record.js";
    import { moveRecordTool } from "./records/move-record.js";
    import { replicateRecordTool } from "./records/replicate-record.js";
    import { duplicateRecordTool } from "./records/duplicate-record.js";
    import { convertRecordTool } from "./records/convert-record.js";
    
    // Groups
    import { listGroupContentTool } from "./groups/list-group-content.js";
    import { selectedRecordsTool } from "./groups/get-selected-records.js";
    
    // Search
    import { searchTool } from "./search/search.js";
    import { lookupRecordTool } from "./search/lookup-record.js";
    
    // Tags
    import { addTagsTool } from "./tags/add-tags.js";
    import { removeTagsTool } from "./tags/remove-tags.js";
    
    // Web
    import { createFromUrlTool } from "./web/create-from-url.js";
    
    // Intelligence
    import { classifyTool } from "./intelligence/classify.js";
    import { compareTool } from "./intelligence/compare.js";
    
    // AI
    import { askAiAboutDocumentsTool } from "./ai/ask-ai-about-documents.js";
    import { checkAiHealthTool } from "./ai/check-ai-health.js";
    import { createSummaryDocumentTool } from "./ai/create-summary-document.js";
    import { getAiToolDocumentationTool } from "./ai/get-ai-tool-documentation.js";
    
    // Custom (our extensions, not from upstream)
    import { listSmartGroupsTool } from "./custom/list-smart-groups.js";
    import { listSmartRulesTool } from "./custom/list-smart-rules.js";
    import { parseEmlHeadersTool } from "./custom/parse-eml-headers.js";
    import { getColumnLayoutTool, copyColumnLayoutTool } from "./custom/column-layout.js";
    
    /** All 33 tools in registration order */
    export const allTools: McpTool[] = [
      // Core (28 tools matching upstream API surface)
      isRunningTool,
      createRecordTool,
      deleteRecordTool,
      moveRecordTool,
      getRecordPropertiesTool,
      getRecordByIdTool,
      searchTool,
      lookupRecordTool,
      createFromUrlTool,
      getOpenDatabasesTool,
      currentDatabaseTool,

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mnott/Devon'

If you have feedback or need assistance with the MCP directory API, please join our Discord server