get_state_management
Retrieve React Native state management standards and guidelines for implementing consistent application state handling.
Instructions
Get state management 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_state_management"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:211-222 (handler)The inline asynchronous handler function for the 'get_state_management' tool. It calls the getStandardContent helper to load the state management standards from 'resources/standards/state_management.md' and returns the content (or error) as a text markdown artifact.
async () => { const result = getStandardContent("standards", "state_management"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], }; }, - src/index.ts:207-223 (registration)Registration of the 'get_state_management' tool on the MCP server, with no input parameters (empty schema) and an inline handler function that provides React Native state management standards.
server.tool( "get_state_management", "Get state management standards for React Native development", {}, async () => { const result = getStandardContent("standards", "state_management"); 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 tool (and others) to read standard content from markdown files in the 'resources/standards' directory. For this tool, it loads 'state_management.md'.
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}` }; } }