get_api_communication
Access API communication standards for React Native development to implement consistent and reliable data exchange in mobile applications.
Instructions
Get API communication standards for React Native development
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:173-184 (handler)Inline asynchronous handler function that fetches and returns the API communication standards content from the markdown file using the shared getStandardContent helper.async () => { const result = getStandardContent("standards", "api_communication"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], }; },
- src/index.ts:169-185 (registration)Registration of the 'get_api_communication' tool on the MCP server instance, specifying name, description, empty input schema, and inline handler.server.tool( "get_api_communication", "Get API communication standards for React Native development", {}, async () => { const result = getStandardContent("standards", "api_communication"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], }; }, );
- src/index.ts:28-42 (helper)Shared helper function used by multiple standard-retrieval tools, including get_api_communication, to read and return content from standard markdown files in the resources/standards directory.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}` }; } }
- build/index.js:140-149 (handler)Runtime (transpiled) inline handler function equivalent to the source in src/index.ts.server.tool("get_api_communication", "Get API communication standards for React Native development", {}, async () => { const result = getStandardContent("standards", "api_communication"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], };
- build/index.js:140-150 (registration)Runtime registration of the tool in the built JavaScript version.server.tool("get_api_communication", "Get API communication standards for React Native development", {}, async () => { const result = getStandardContent("standards", "api_communication"); return { content: [ { type: "text", text: result.content ?? result.error ?? "Error: No content or error message available", }, ], }; });