Skip to main content

List Resources

Get a comprehensive view of all your Tokencraft resources with their IDs. This tool provides a hierarchical view of your design token structure, making it easy to navigate and find the correct IDs for other operations.

Description

This helper tool provides a complete overview of your Tokencraft resources in a single call. It can show just workspaces, or the full hierarchy including tokensets and modes when a workspace ID is provided.

Parameters

ParameterTypeRequiredDescription
workspace_idstringNoOptional workspace ID to get tokensets and modes

Response

Returns a hierarchical view with:
  • workspaces: Array of all workspaces with IDs and names
  • tokensets: Array of tokensets (if workspace_id provided)
  • modes: Object with modes for each tokenset (if workspace_id provided)
  • usage: Instructions on how to use the returned IDs

Example Usage

Get all workspaces only

list_resources()

Get full hierarchy for a workspace

list_resources(workspace_id: "0afa0a8a-5e59-4ef9-9619-c12ecdad3c1a")

Example Response

{
  "workspaces": [
    {
      "id": "0afa0a8a-5e59-4ef9-9619-c12ecdad3c1a",
      "name": "My Workspace",
      "description": "Default workspace"
    }
  ],
  "tokensets": [
    {
      "id": "164809aa-cbd2-4c5f-ac1a-af6902c29f6e",
      "name": "Core",
      "description": "Core design tokens"
    },
    {
      "id": "3f172bda-c0d1-4788-a91c-c25be188b996",
      "name": "Brand",
      "description": "Brand-specific tokens"
    }
  ],
  "modes": {
    "164809aa-cbd2-4c5f-ac1a-af6902c29f6e": [
      {
        "id": "2edd637b-5088-4c9b-abbc-e431e5816e94",
        "name": "Light",
        "is_default": true
      }
    ],
    "3f172bda-c0d1-4788-a91c-c25be188b996": [
      {
        "id": "58c61b7d-9008-4efd-908d-f6bdd104da92",
        "name": "Light",
        "is_default": true
      },
      {
        "id": "50e82331-4ebc-4590-87a9-b0c6c4dd9fd2",
        "name": "Dark",
        "is_default": false
      }
    ]
  },
  "usage": "Use these IDs in other tools. Call with workspace_id to get full hierarchy."
}

Use Cases

  • Resource discovery: Get a complete overview of your design token structure
  • ID reference: Find the correct IDs for other operations
  • Hierarchy navigation: Understand the relationship between workspaces, tokensets, and modes
  • Error prevention: Avoid using invalid IDs in other tools
  • search_tokens - Search for specific tokens across resources
  • get_default_mode_tokens - Get tokens from the default mode
  • create_token - Create tokens using the IDs from this tool
  • export_tokenset - Export tokensets using the IDs from this tool

Workflow Example

# 1. Get overview of all resources
list_resources()

# 2. Get detailed hierarchy for a specific workspace
list_resources(workspace_id: "0afa0a8a-5e59-4ef9-9619-c12ecdad3c1a")

# 3. Use the IDs for other operations
create_token(
  tokenset_id: "164809aa-cbd2-4c5f-ac1a-af6902c29f6e",
  mode_id: "2edd637b-5088-4c9b-abbc-e431e5816e94",
  name: "primary-color",
  type: "color",
  value: "#0066CC"
)

Best Practices

  1. Start with overview: Call without parameters first to see all workspaces
  2. Drill down: Use workspace_id to get detailed hierarchy
  3. Copy exact IDs: Use the exact UUID from the response
  4. Check relationships: Verify tokenset and mode relationships before operations

Error Prevention

This tool helps prevent common errors:
  • ❌ Using invalid workspace IDs
  • ❌ Using invalid tokenset IDs
  • ❌ Using invalid mode IDs
  • ❌ Confusing workspace IDs with tokenset IDs
  • ✅ Getting valid, current IDs for all operations