Skip to main content
Glama

search_design_tokens

Search KRDS design tokens including colors, spacing, and typography to find specific values for Korean government digital services.

Instructions

KRDS 디자인 토큰을 검색합니다 (색상, 간격, 타이포그래피 등).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNo토큰 타입 (예: color, spacing, typography)
queryNo검색할 키워드 (예: primary, blue, font)

Implementation Reference

  • Core handler function implementing the search_design_tokens tool logic. It delegates to KRDSLoader.searchTokens with optional type and query filters.
    export async function searchDesignTokens( loader: KRDSLoader, type?: string, query?: string ): Promise<TokenSearchResult[]> { return await loader.searchTokens(type, query); }
  • src/index.ts:151-167 (registration)
    Tool registration in getTools() method, defining name 'search_design_tokens', description, and input schema.
    { name: 'search_design_tokens', description: 'KRDS 디자인 토큰을 검색합니다 (색상, 간격, 타이포그래피 등).', inputSchema: { type: 'object', properties: { type: { type: 'string', description: '토큰 타입 (예: color, spacing, typography)', }, query: { type: 'string', description: '검색할 키워드 (예: primary, blue, font)', }, }, }, },
  • MCP protocol handler that executes the tool, calls the core searchDesignTokens function, handles empty results, formats output as formatted text response.
    private async handleSearchTokens(args: any) { const results = await searchDesignTokens(this.loader, args?.type, args?.query); if (results.length === 0) { return { content: [{ type: 'text', text: '검색 결과가 없습니다.', }], }; } const text = `찾은 디자인 토큰 (${results.length}개):\n\n` + results.slice(0, 50).map(token => `🎨 ${token.name}\n` + ` 값: ${token.value}\n` + ` 타입: ${token.type}\n` + ` CSS: var(${token.cssVariable})\n` + ` SCSS: ${token.scssVariable}` ).join('\n\n') + (results.length > 50 ? `\n\n... 그 외 ${results.length - 50}개` : ''); return { content: [{ type: 'text', text }], }; }
  • TypeScript interface defining the structure of TokenSearchResult, used as output type for the search_design_tokens tool.
    export interface TokenSearchResult { name: string; value: string; type: string; cssVariable?: string; scssVariable?: string; }

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/re-rank/UIUX-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server