Problem Statement
PatternFly design tokens are available in @patternfly/react-tokens but there is no API endpoint to fetch them programmatically.
Key Requirement: The API must support fine-grained filtering to minimize response size for MCP/LLM consumption, reducing context bloat when fetching tokens.
Goal
Create API endpoints that expose global design tokens with a hierarchical structure consistent with existing API patterns, enabling MCPs and other consumers to fetch only the specific tokens they need.
Proposed Solution
Add design token endpoints following the existing API hierarchy pattern:
GET /api/v6/tokens → Returns list of available token categories
GET /api/v6/tokens/[category] → Returns tokens for a specific category
GET /api/v6/tokens/[category]?filter=brand → Returns filtered tokens for a specific category
GET /api/v6/tokens/all → Returns all tokens
Completion Criteria
Out of Scope
Jira Issue: PF-2809
Problem Statement
PatternFly design tokens are available in
@patternfly/react-tokensbut there is no API endpoint to fetch them programmatically.Key Requirement: The API must support fine-grained filtering to minimize response size for MCP/LLM consumption, reducing context bloat when fetching tokens.
Goal
Create API endpoints that expose global design tokens with a hierarchical structure consistent with existing API patterns, enabling MCPs and other consumers to fetch only the specific tokens they need.
Proposed Solution
Add design token endpoints following the existing API hierarchy pattern:
GET /api/v6/tokens→ Returns list of available token categoriesGET /api/v6/tokens/[category]→ Returns tokens for a specific categoryGET /api/v6/tokens/[category]?filter=brand→ Returns filtered tokens for a specific categoryGET /api/v6/tokens/all→ Returns all tokensCompletion Criteria
API Routes Created
/api/[version]/tokens/index.tsroute returning array of available categories/api/[version]/tokens/[category].tsroute returning tokens for a specific category/api/[version]/tokens/all.tsroute returning all tokens grouped by categoryRoute:
/api/[version]/tokens(index)Route:
/api/[version]/tokens/[category]{ name: string, value: string, var: string }?filter=query parameter for case-insensitive substring match on token nameRoute:
/api/[version]/tokens/all?filter=query parameter to filter across all categoriesError Handling
Documentation
src/pages/api/[version]/index.tsendpoints array with all token endpointsfilterquery parameter with examples/api/openapi.json.tsif applicableTesting
/api/[version]/tokensindex route/api/[version]/tokens/[category]route (multiple categories)/api/[version]/tokens/[category]?filter=route/api/[version]/tokens/allroute (verify ~773 tokens)/api/[version]/tokens/all?filter=routeOut of Scope
Jira Issue: PF-2809