Skip to main content
Glama

get_record_by_identifier

Retrieve DEVONthink records using UUIDs for cross-database access or numeric IDs with database specification to locate documents and metadata efficiently.

Instructions

Get a DEVONthink record using its UUID or ID. UUID lookup works across all open databases. Numeric ID lookup requires databaseName to be specified.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNoUUID of the record (preferred — works across all databases)
idNoNumeric record ID (requires databaseName)
databaseNameNoDatabase name (required when using numeric id)

Implementation Reference

  • The complete definition and handler for the get_record_by_identifier tool.
    export const getRecordByIdTool = defineTool({
      name: "get_record_by_identifier",
      description:
        "Get a DEVONthink record using its UUID or ID. " +
        "UUID lookup works across all open databases. " +
        "Numeric ID lookup requires databaseName to be specified.",
      schema: z.object({
        uuid: z.string().optional().describe("UUID of the record (preferred — works across all databases)"),
        id: z.number().int().nonnegative().optional().describe("Numeric record ID (requires databaseName)"),
        databaseName: z.string().optional().describe("Database name (required when using numeric id)"),
      }),
      run: async (args, executor) => {
        const { uuid, id, databaseName } = args;
    
        if (!uuid && id === undefined) {
          return { error: "Either uuid or id must be provided" };
        }
    
        const script = `
          ${JXA_APP}
          var uuid = ${jxaLiteral(uuid ?? null)};
          var recordId = ${jxaLiteral(id ?? null)};
          var dbName = ${jxaLiteral(databaseName ?? null)};
    
          ${JXA_RESOLVE_DB}
    
          var record;
          if (uuid) {
            record = app.getRecordWithUuid(uuid);
            if (!record || !record.uuid()) throw new Error("Record not found for UUID: " + uuid);
          } else {
            if (!db) throw new Error("databaseName is required when using numeric id");
            record = db.getRecordAt(recordId);
            if (!record || !record.uuid()) throw new Error("Record not found for ID: " + recordId);
          }
    
          JSON.stringify(${JXA_RECORD_PROPS});
        `;
    
        const result = executor.run(script);
        return JSON.parse(result.stdout);
      },
    });
Behavior3/5

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

No annotations provided, so description carries full burden. It successfully explains lookup scope (UUID works across all open databases), but misses return value specification, error handling (what if ID not found?), and read-only safety confirmation.

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?

Two well-structured sentences with zero waste. First sentence establishes core purpose; second provides critical parameter logic. Appropriately front-loaded.

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?

Given 100% schema coverage, parameters are well-documented. However, with no output schema and multiple sibling 'get_record_*' tools, the description should specify what this returns (likely a record reference/metadata) to distinguish from content/properties retrieval.

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?

With 100% schema coverage, baseline is 3. The description adds valuable semantic context about the relationship between parameters—specifically the cross-database vs single-database scope constraints that affect which identifier to use.

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?

Clear verb ('Get') and resource ('DEVONthink record') with specific identifier types (UUID/ID). However, it doesn't distinguish from sibling 'lookup_record' or clarify what 'get' returns (metadata vs reference) compared to 'get_record_content' or 'get_record_properties'.

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

Usage Guidelines3/5

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

Provides clear guidance on parameter selection (UUID preferred for cross-database, ID requires databaseName), but lacks explicit 'when to use vs alternatives' guidance regarding 'search', 'lookup_record', or other retrieval tools.

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