Skip to main content
Glama

list_group_content

Retrieve content from DEVONthink groups by specifying a UUID or database root to access documents and records for management and analysis.

Instructions

Lists the content of a specific group in DEVONthink. Supply a group UUID to list any group directly, or omit uuid to list the root of the current (or named) database.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidNoUUID of the group to list. If omitted, the database root is listed
databaseNameNoName of the database to use when resolving the root group. If omitted, the current database is used. Ignored when uuid is provided

Implementation Reference

  • The main tool definition and handler for 'list_group_content', which fetches group contents from DEVONthink using JXA.
    export const listGroupContentTool = defineTool({
      name: "list_group_content",
      description:
        "Lists the content of a specific group in DEVONthink. " +
        "Supply a group UUID to list any group directly, or omit uuid to list " +
        "the root of the current (or named) database.",
      schema: z.object({
        uuid: z
          .string()
          .optional()
          .describe(
            "UUID of the group to list. If omitted, the database root is listed"
          ),
        databaseName: z
          .string()
          .optional()
          .describe(
            "Name of the database to use when resolving the root group. " +
            "If omitted, the current database is used. Ignored when uuid is provided"
          ),
      }),
      run: async (args, executor) => {
        const { uuid, databaseName } = args;
    
        const script = `
          ${JXA_APP}
          var uuid = ${jxaLiteral(uuid ?? null)};
          var dbName = ${jxaLiteral(databaseName ?? null)};
    
          var group;
          if (uuid) {
            // Fetch the group directly by UUID
            group = app.getRecordWithUuid(uuid);
            if (!group || !group.uuid()) {
              throw new Error("Group not found for UUID: " + uuid);
            }
          } else {
            // Fall back to the database root
            ${JXA_RESOLVE_DB}
            group = db.root();
            if (!group || !group.uuid()) {
              throw new Error("Could not retrieve database root");
            }
          }
    
          // List the direct children
          var children = group.children();
          var result = [];
          for (var i = 0; i < children.length; i++) {
            var record = children[i];
            result.push(${JXA_RECORD_SUMMARY});
          }
    
          JSON.stringify(result);
        `;
    
        const result = executor.run(script);
        return JSON.parse(result.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 Zod schema defining the input arguments (uuid and databaseName) for the tool.
    schema: z.object({
      uuid: z
        .string()
        .optional()
        .describe(
          "UUID of the group to list. If omitted, the database root is listed"
        ),
      databaseName: z
        .string()
        .optional()
        .describe(
          "Name of the database to use when resolving the root group. " +
          "If omitted, the current database is used. Ignored when uuid is provided"
        ),
    }),
  • The registration of 'listGroupContentTool' within the central tools index.
    listGroupContentTool,

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