Skip to main content
Glama

list_smart_groups

Retrieve DEVONthink smart groups with names, UUIDs, and sync data for querying contents. Smart groups are only accessible through this method, not via standard AppleScript API.

Instructions

List all DEVONthink smart groups by parsing SmartGroups.plist. Returns name, UUID (from sync.UUID), sync date, and UseUUIDKey flag for each smart group. Smart groups are NOT accessible via the standard AppleScript API — this is the only way to enumerate them. Use the returned uuid with the search tool (groupUuid parameter) to query the contents of a smart group.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual logic for listing and parsing DEVONthink smart groups from the SmartGroups.plist file.
    const listSmartGroups = async (): Promise<SmartGroupsResult> => {
      if (!existsSync(PLIST_PATH)) {
        return {
          success: false,
          error: `SmartGroups.plist not found at: ${PLIST_PATH}. Ensure DEVONthink has been run at least once.`,
        };
      }
    
      let xml: string;
      try {
        xml = execSync(`plutil -convert xml1 -o - "${PLIST_PATH}"`, {
          encoding: "utf-8",
          timeout: 10000,
        });
      } catch (err) {
        return {
          success: false,
          error: `Failed to parse SmartGroups.plist: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    
      let smartGroups: SmartGroupEntry[];
      try {
        smartGroups = parsePlistXmlToSmartGroups(xml);
      } catch (err) {
        return {
          success: false,
          error: `Failed to parse XML output from plutil: ${err instanceof Error ? err.message : String(err)}`,
        };
      }
    
      smartGroups.sort((a, b) => a.name.localeCompare(b.name));
    
      return { success: true, smartGroups, totalCount: smartGroups.length };
    };
  • The MCP tool definition for `list_smart_groups`, associating it with the `listSmartGroups` handler.
    export const listSmartGroupsTool: McpTool = {
      name: "list_smart_groups",
      description:
        "List all DEVONthink smart groups by parsing SmartGroups.plist. " +
        "Returns name, UUID (from sync.UUID), sync date, and UseUUIDKey flag for each smart group. " +
        "Smart groups are NOT accessible via the standard AppleScript API — this is the only way to enumerate them. " +
        "Use the returned uuid with the search tool (groupUuid parameter) to query the contents of a smart group.",
      inputSchema: {
        type: "object" as const,
        properties: {},
        additionalProperties: false,
      },
      run: listSmartGroups,
    };

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