Skip to main content
Glama

replicate_record

Create a copy of a database record in a destination group. Replicants share data — editing one affects all copies. Specify source by UUID, record ID, or path.

Instructions

Replicate a record within the same database to a destination group. Replicants share the same underlying data — editing one affects all replicants. Destination group UUID is required. Resolve the source record by uuid (preferred), recordId + databaseName, or recordPath + databaseName. Returns the properties of the new replicant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNoUUID of the record to replicate
recordIdNoNumeric record ID (requires databaseName)
recordPathNoRecord path within the database (requires databaseName)
destinationGroupUuidYesUUID of the destination group for the replicant
databaseNameNoDatabase name (required for recordId or recordPath lookups)

Implementation Reference

  • The 'run' function handles the execution of the JXA script to replicate a DEVONthink record.
    run: async (args, executor) => {
      const { uuid, recordId, recordPath, destinationGroupUuid, databaseName } = args;
    
      const script = `
        ${JXA_APP}
        var uuid = ${jxaLiteral(uuid ?? null)};
        var recordId = ${jxaLiteral(recordId ?? null)};
        var recordPath = ${jxaLiteral(recordPath ?? null)};
        var recordName = null;
        var dbName = ${jxaLiteral(databaseName ?? null)};
        var destinationGroupUuid = ${jxaLiteral(destinationGroupUuid)};
    
        ${JXA_RESOLVE_DB}
        ${JXA_RESOLVE_RECORD}
    
        var destGroup = app.getRecordWithUuid(destinationGroupUuid);
        if (!destGroup || !destGroup.uuid()) throw new Error("Destination group not found for UUID: " + destinationGroupUuid);
    
        var replicant = app.replicate({record: record, to: destGroup});
        if (!replicant || !replicant.uuid()) throw new Error("Replicate operation failed");
    
        var record = replicant;
        JSON.stringify(${JXA_RECORD_PROPS});
      `;
    
      const result = executor.run(script);
      return JSON.parse(result.stdout);
    },
  • Input schema for the 'replicate_record' tool.
    schema: z.object({
      uuid: z.string().optional().describe("UUID of the record to replicate"),
      recordId: z.number().int().nonnegative().optional().describe("Numeric record ID (requires databaseName)"),
      recordPath: z.string().optional().describe("Record path within the database (requires databaseName)"),
      destinationGroupUuid: z.string().describe("UUID of the destination group for the replicant"),
      databaseName: z.string().optional().describe("Database name (required for recordId or recordPath lookups)"),
    }),
  • Tool registration for 'replicate_record'.
    export const replicateRecordTool = defineTool({
      name: "replicate_record",
Behavior4/5

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

With no annotations provided, the description carries full burden and successfully discloses the critical behavioral trait: 'Replicants share the same underlying data — editing one affects all replicants.' It also notes the return value. Missing minor safety hints (permissions, reversibility) but covers the essential mutation semantics.

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?

Four sentences with zero waste: (1) purpose/scope, (2) critical behavioral distinction, (3) required parameter, (4) resolution options and return value. Front-loaded with the core action and efficiently structured.

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

Completeness4/5

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

Given 5 parameters with complex lookup logic and no annotations, the description adequately covers the replication model, parameter relationships, and return value. Slightly short on error conditions or edge cases (e.g., invalid destination group), but sufficient for correct invocation.

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?

Schema coverage is 100% so baseline is 3. The description adds significant value by specifying the lookup resolution hierarchy ('uuid preferred'), explaining parameter dependencies (recordId requires databaseName), and clarifying the mutual exclusivity logic of the identification parameters.

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

Purpose5/5

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

Specific verb 'Replicate' + resource 'record' + scope 'within the same database to a destination group'. Crucially distinguishes from sibling 'duplicate_record' by defining replicants as sharing underlying data, making the tool's unique purpose immediately clear.

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

Usage Guidelines4/5

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

Explains three valid methods to resolve the source record (uuid preferred, or recordId/databaseName, or recordPath/databaseName) and states the destinationGroupUuid requirement. Implies when to use versus 'duplicate_record' by emphasizing the shared-data behavior, though it doesn't explicitly name the sibling alternative.

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