Skip to main content
Glama

get_record_content

Retrieve plain text or HTML content from DEVONthink records using UUID. Returns text for text-based records, HTML for web content, or null for binary files like PDFs and images.

Instructions

Gets the content of a specific record in DEVONthink. Returns plain text for text-based records, or HTML source for web/HTML records. Binary records (PDF, images) return null for content. UUID is required; databaseName is optional.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesUUID of the record whose content to retrieve
databaseNameNoDatabase name (optional, for disambiguation)

Implementation Reference

  • The 'run' function within the getRecordContentTool definition executes the JXA script to retrieve record content from DEVONthink.
    run: async (args, executor) => {
      const { uuid, databaseName } = args;
    
      const script = `
        ${JXA_APP}
        var uuid = ${jxaLiteral(uuid)};
        var dbName = ${jxaLiteral(databaseName ?? null)};
    
        var record = app.getRecordWithUuid(uuid);
        if (!record || !record.uuid()) throw new Error("Record not found for UUID: " + uuid);
    
        var content = null;
        try { content = record.plainText(); } catch(e) {}
        if (!content) {
          try { content = record.source(); } catch(e) {}
        }
    
        JSON.stringify({
          uuid: record.uuid(),
          name: record.name(),
          type: record.type(),
          content: content || null
        });
      `;
    
      const result = executor.run(script);
      return JSON.parse(result.stdout);
    },
  • Input validation schema for the get_record_content tool.
    schema: z.object({
      uuid: z.string().describe("UUID of the record whose content to retrieve"),
      databaseName: z.string().optional().describe("Database name (optional, for disambiguation)"),
    }),
  • Registration of the get_record_content tool using defineTool.
    export const getRecordContentTool = defineTool({
      name: "get_record_content",
      description:
        "Gets the content of a specific record in DEVONthink. " +
        "Returns plain text for text-based records, or HTML source for web/HTML records. " +
        "Binary records (PDF, images) return null for content. " +
        "UUID is required; databaseName is optional.",
      schema: z.object({
        uuid: z.string().describe("UUID of the record whose content to retrieve"),
        databaseName: z.string().optional().describe("Database name (optional, for disambiguation)"),
      }),
      run: async (args, executor) => {
        const { uuid, databaseName } = args;
    
        const script = `
          ${JXA_APP}
          var uuid = ${jxaLiteral(uuid)};
          var dbName = ${jxaLiteral(databaseName ?? null)};
    
          var record = app.getRecordWithUuid(uuid);
          if (!record || !record.uuid()) throw new Error("Record not found for UUID: " + uuid);
    
          var content = null;
          try { content = record.plainText(); } catch(e) {}
          if (!content) {
            try { content = record.source(); } catch(e) {}
          }
    
          JSON.stringify({
            uuid: record.uuid(),
            name: record.name(),
            type: record.type(),
            content: content || null
          });
        `;
    
        const result = executor.run(script);
        return JSON.parse(result.stdout);
      },
    });
Behavior5/5

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

Excellent disclosure given zero annotations. Explicitly details return value variations (plain text vs HTML source vs null for binary), which is critical since no output schema exists. Fully describes the content retrieval behavior across different record types.

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, each earning its place: purpose statement, text/HTML return behavior, binary null behavior, and parameter requirements. Front-loaded with the core action, no redundancy or filler despite covering multiple content type scenarios.

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

Completeness5/5

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

Comprehensive for a content retrieval tool. Compensates for missing output schema by detailing all possible return types (text, HTML, null). Covers both parameters adequately given the 100% schema coverage. Sufficient for agent to invoke correctly without external documentation.

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

Parameters3/5

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

Schema coverage is 100%, with uuid and databaseName fully documented in the schema. Description restates 'UUID is required; databaseName is optional' which confirms the schema's required field and descriptions but adds no additional semantic context beyond the structured definitions.

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?

Clear verb 'Gets' + specific resource 'content of a specific record' + domain context 'DEVONthink'. Distinguishes from siblings like get_record_properties (metadata vs content) and update_record_content through the 'Gets' verb and return type descriptions.

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 implied usage guidance by documenting that binary records return null, warning agents not to expect extractable content from PDFs/images. However, lacks explicit comparison to siblings like get_record_properties or lookup_record for when to choose this over alternatives.

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