get-user-version
Specify the target React Native version for upgrading your project, enabling preview of changes before migration.
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 takes the input 'version' parameter and returns it as text content in the response.async ({ version }) => { return { content: [{ type: "text", text: version }] } });
- src/tools.ts:26-28 (schema)The input schema for the 'get-user-version' tool, defining a single string parameter 'version'.inputSchema: { version: z.string().describe("The version of React Native that the user wants to upgrade to") }
- src/tools.ts:7-34 (registration)The registration of the 'get-user-version' tool on the MCP server, including title, description, input schema, and 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 }] } });