get-template
Retrieve a specific template by its ID from the Novita AI platform to access predefined configurations for GPU instances.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| templateId | Yes | ID of the template to retrieve |
Implementation Reference
- src/tools.ts:332-347 (handler)Handler function that retrieves the specified template by ID using the novitaRequest API and returns a text content block with the JSON-stringified result.}, async (params) => { const queryParams = new URLSearchParams(); queryParams.append("templateId", params.templateId); const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ""; const result = await novitaRequest(`/template${queryString}`); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; });
- src/tools.ts:329-331 (schema)Zod input schema defining the required 'templateId' parameter as a string.templateId: z .string() .describe("ID of the template to retrieve"),
- src/tools.ts:328-347 (registration)Registration of the 'get-template' tool on the MCP server, including inline schema and handler function.server.tool("get-template", { templateId: z .string() .describe("ID of the template to retrieve"), }, async (params) => { const queryParams = new URLSearchParams(); queryParams.append("templateId", params.templateId); const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ""; const result = await novitaRequest(`/template${queryString}`); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; });