Skip to main content
Glama

selected_records

Retrieve details about records currently highlighted in DEVONthink to access document information without manual searching.

Instructions

Get information about currently selected records in DEVONthink.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'selected_records' tool. It executes a JXA script to fetch records currently selected in the DEVONthink application and returns their summaries.
    export const selectedRecordsTool = defineTool({
      name: "selected_records",
      description:
        "Get information about currently selected records in DEVONthink.",
      schema: z.object({}),
      run: async (_args, executor) => {
        const script = `
    ${JXA_APP}
    var records = app.selectedRecords();
    var result = [];
    for (var i = 0; i < records.length; i++) {
      var record = records[i];
      result.push(${JXA_RECORD_SUMMARY});
    }
    JSON.stringify(result);
    `.trim();
    
        const { stdout } = executor.run(script);
        return JSON.parse(stdout) as Array<{
          uuid: string;
          name: string;
          type: string;
          location: string;
          database: string;
          tags: string[];
          score: number;
          flagged: boolean;
          label: number;
          modificationDate: string | null;
        }>;
      },
    });
  • The registration of the 'selectedRecordsTool' in the 'allTools' array.
    selectedRecordsTool,

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