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,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full disclosure burden. It adds valuable context that this depends on UI state ('currently selected'), but fails to describe the return format, what specific database metadata is returned, or whether the operation is safe/read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no redundant words. It front-loads the verb and resource, making it immediately scannable for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While adequate for a parameterless tool, the description lacks specifics about the return value structure or content since no output schema is provided. It should indicate what database properties are returned (e.g., name, UUID, path) to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema contains zero parameters. Per evaluation rules, this establishes a baseline score of 4, as there are no parameter semantics to clarify beyond the schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the action ('Get information') and target resource ('currently selected database'), including the application context (DEVONthink). It distinguishes from sibling 'get_open_databases' by specifying 'currently selected,' though it could clarify what 'information' specifically includes (name, ID, path, etc.).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_open_databases.' It does not specify prerequisites (e.g., that a database must be selected) or error conditions if none is selected.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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