Skip to main content
Glama

get_krds_resources

Retrieve file paths and usage instructions for KRDS design system resources including CSS, SCSS, fonts, images, and JavaScript components to build compliant Korean government digital services.

Instructions

KRDS 리소스 파일 경로와 사용법을 가져옵니다.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resourceTypeYes리소스 타입 (css, scss, fonts, images, js)

Implementation Reference

  • Main handler function for 'get_krds_resources' tool. Validates input, fetches resource paths using KRDSLoader, formats usage information and file list into a markdown response.
    private async handleGetResources(args: any) { if (!args?.resourceType) { throw new Error('resourceType이 필요합니다.'); } const files = await this.loader.getResourcePaths(args.resourceType); const usageMap: Record<string, string> = { css: 'HTML에서 사용: <link rel="stylesheet" href="node_modules/krds-uiux/resources/css/krds.css">', scss: 'SCSS 파일에서 import: @import "node_modules/krds-uiux/resources/scss/krds";', fonts: '폰트는 CSS 파일에 이미 포함되어 있습니다.', images: 'HTML에서 사용: <img src="node_modules/krds-uiux/resources/img/image.png">', js: 'JavaScript에서 import: import "node_modules/krds-uiux/resources/js/krds.js";', }; const text = `# KRDS ${args.resourceType.toUpperCase()} 리소스\n\n` + `**파일 개수:** ${files.length}개\n\n` + (files.length > 0 ? `**파일 목록:**\n${files.map(f => `• ${f}`).join('\n')}\n\n` : '파일이 없습니다.\n\n') + `**사용법:**\n${usageMap[args.resourceType as keyof typeof usageMap] || '사용법 정보가 없습니다.'}`; return { content: [{ type: 'text', text }], }; }
  • Core helper method in KRDSLoader that reads the directory for the specified resource type and returns relative paths to the resource files.
    async getResourcePaths(resourceType: 'css' | 'scss' | 'fonts' | 'images' | 'js'): Promise<string[]> { const resourcesPath = join(this.krdsPath, 'resources'); const targetPath = join(resourcesPath, resourceType); try { const files = await readdir(targetPath); return files.map(file => join('node_modules', 'krds-uiux', 'resources', resourceType, file)); } catch { return []; } }
  • src/index.ts:198-212 (registration)
    Tool registration in getTools() method, including name, description, and input schema definition.
    { name: 'get_krds_resources', description: 'KRDS 리소스 파일 경로와 사용법을 가져옵니다.', inputSchema: { type: 'object', properties: { resourceType: { type: 'string', description: '리소스 타입 (css, scss, fonts, images, js)', enum: ['css', 'scss', 'fonts', 'images', 'js'], }, }, required: ['resourceType'], }, },
  • src/index.ts:81-82 (registration)
    Handler dispatch registration in the switch statement within CallToolRequestSchema handler.
    case 'get_krds_resources': return await this.handleGetResources(args);
  • Input schema definition for the resourceType parameter, including type, description, and allowed enum values.
    resourceType: { type: 'string', description: '리소스 타입 (css, scss, fonts, images, js)', enum: ['css', 'scss', 'fonts', 'images', 'js'], }, }, required: ['resourceType'], },

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