get-user-version
Retrieve the specific React Native version targeted for upgrading. Ensures the version is valid, supports semantic and release candidate formats, and integrates with tools for previewing changes and migration guidance.
Instructions
Gets the version of React Native that the user wants to upgrade to.
OVERVIEW: This tool is used to get the version of React Native that the user wants to upgrade to.
USAGE: • This tool is used to get the version of React Native that the user wants to upgrade to. • The version can be used with the "get-react-native-diff" tool to preview changes before upgrading.
IMPORTANT NOTES: • The version must be a valid semantic version number. e.g. 0.72.0 • The version must be a valid release candidate version number. e.g. 0.72.0-rc.0 • If the version is not a valid semantic version number or release candidate version number, the tool should provide a message that asks the user to provide a valid version. • If the user wants to upgrade to the latest stable version, call the get-stable-version tool to get the latest stable version. • If the user wants to upgrade to the latest release candidate version, call the get-rc-version tool to get the latest release candidate version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | Yes | The version of React Native that the user wants to upgrade to |
Implementation Reference
- src/tools.ts:30-34 (handler)The handler function for the 'get-user-version' tool. It destructures the 'version' input parameter and returns it wrapped in the expected MCP response format as text content.async ({ version }) => { return { content: [{ type: "text", text: version }] } });
- src/tools.ts:26-28 (schema)Input schema definition using Zod for the 'get-user-version' tool, specifying a required 'version' string parameter.inputSchema: { version: z.string().describe("The version of React Native that the user wants to upgrade to") }
- src/tools.ts:7-34 (registration)Registration of the 'get-user-version' tool using server.registerTool, including title, detailed description, input schema, and inline handler function.server.registerTool('get-user-version', { title: "Get User Desired Version of React Native", description: `Gets the version of React Native that the user wants to upgrade to. OVERVIEW: This tool is used to get the version of React Native that the user wants to upgrade to. USAGE: • This tool is used to get the version of React Native that the user wants to upgrade to. • The version can be used with the "get-react-native-diff" tool to preview changes before upgrading. IMPORTANT NOTES: • The version must be a valid semantic version number. e.g. 0.72.0 • The version must be a valid release candidate version number. e.g. 0.72.0-rc.0 • If the version is not a valid semantic version number or release candidate version number, the tool should provide a message that asks the user to provide a valid version. • If the user wants to upgrade to the latest stable version, call the get-stable-version tool to get the latest stable version. • If the user wants to upgrade to the latest release candidate version, call the get-rc-version tool to get the latest release candidate version. `, inputSchema: { version: z.string().describe("The version of React Native that the user wants to upgrade to") } }, async ({ version }) => { return { content: [{ type: "text", text: version }] } });