get-gpu-instance
Retrieve details of a specific GPU instance on the Novita AI platform by providing its instance ID for management and monitoring purposes.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | ID of the instance to retrieve |
Implementation Reference
- src/tools.ts:121-139 (handler)The handler function that fetches the GPU instance details using the provided instanceId by making an API request to `/gpu/instance`, clears sensitive information from the result, and returns it as JSON text content.}, async (params) => { // Construct query parameters const queryParams = new URLSearchParams(); queryParams.append("instanceId", params.instanceId); const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ""; const result = await novitaRequest(`/gpu/instance${queryString}`); clearSensitiveInfo(result); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; });
- src/tools.ts:118-120 (schema)Input schema validation using Zod for the required 'instanceId' parameter.instanceId: z .string() .describe("ID of the instance to retrieve"),
- src/tools.ts:117-139 (registration)Registration of the 'get-gpu-instance' tool on the MCP server, including schema and inline handler function.server.tool("get-gpu-instance", { instanceId: z .string() .describe("ID of the instance to retrieve"), }, async (params) => { // Construct query parameters const queryParams = new URLSearchParams(); queryParams.append("instanceId", params.instanceId); const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ""; const result = await novitaRequest(`/gpu/instance${queryString}`); clearSensitiveInfo(result); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; });
- src/index.ts:23-23 (registration)Top-level call to registerAllTools which includes registration of GPU instance tools containing 'get-gpu-instance'.registerAllTools(server);