get_component_design
Retrieve React Native component design standards to ensure consistent UI implementation across applications.
Instructions
Get component design standards for React Native development
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_component_design"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:188-204 (registration)Registration of the 'get_component_design' tool, including empty input schema and inline async handler that calls getStandardContent to load and return the component design standards from resources/standards/component_design.md
server.tool( "get_component_design", "Get component design standards for React Native development", {}, async () => { const result = getStandardContent("standards", "component_design"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], }; }, ); - src/index.ts:192-203 (handler)The handler function for the tool, which fetches the standard content using getStandardContent and formats it as MCP content response.
async () => { const result = getStandardContent("standards", "component_design"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], }; }, - src/index.ts:28-42 (helper)Helper function used by the handler to read the markdown file resources/standards/component_design.md containing the design standards.
function getStandardContent(category: string, standardId: string): { content?: string; error?: string } { const standardPath = path.join(RESOURCES_DIR, category, `${standardId}.md`); if (!fs.existsSync(standardPath)) { return { error: `Standard ${standardId} not found` }; } try { const content = fs.readFileSync(standardPath, 'utf8'); return { content }; } catch (err) { console.error(`Error reading standard ${standardId}:`, err); return { error: `Error reading standard ${standardId}` }; } }