Skip to main content
Glama
novitalabs

Novita MCP Server

Official
by novitalabs

list-templates

Browse available GPU instance templates for Novita AI platform, filtering by type and channel to find suitable configurations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageSizeNoNumber of templates to return in each page
pageNumNoPage number to return, start from 1
typeNoType of template to return
channelNoChannels of template to return

Implementation Reference

  • The handler function for the 'list-templates' tool. It constructs query parameters based on input params (pageSize, pageNum, type, channel), makes an API request to '/templates' endpoint using novitaRequest, and returns the result as a formatted text content block.
    }, async (params) => { const queryParams = new URLSearchParams(); if (params.pageSize) queryParams.append("pageSize", params.pageSize.toString()); if (params.pageNum) queryParams.append("pageNum", params.pageNum.toString()); if (params.type) queryParams.append("type", params.type); if (params.channel) queryParams.append("channel", params.channel.join(",")); const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ""; const result = await novitaRequest(`/templates${queryString}`); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; });
  • Zod schema defining input parameters for the 'list-templates' tool: pagination (pageSize, pageNum), filtering by type (instance/serverless) and channel (private/community/official).
    pageSize: z .number() .min(0) .default(20) .optional() .describe("Number of templates to return in each page"), pageNum: z .number() .min(0) .default(1) .optional() .describe("Page number to return, start from 1"), type: z .enum(["instance", "serverless"]) .optional() .describe("Type of template to return"), channel: z .enum(["private", "community", "official"]) .array() .optional() .describe("Channels of template to return"),
  • src/tools.ts:282-326 (registration)
    Registration of the 'list-templates' MCP tool using server.tool(), including input schema and inline handler implementation within registerTemplateTools function.
    server.tool("list-templates", { pageSize: z .number() .min(0) .default(20) .optional() .describe("Number of templates to return in each page"), pageNum: z .number() .min(0) .default(1) .optional() .describe("Page number to return, start from 1"), type: z .enum(["instance", "serverless"]) .optional() .describe("Type of template to return"), channel: z .enum(["private", "community", "official"]) .array() .optional() .describe("Channels of template to return"), }, async (params) => { const queryParams = new URLSearchParams(); if (params.pageSize) queryParams.append("pageSize", params.pageSize.toString()); if (params.pageNum) queryParams.append("pageNum", params.pageNum.toString()); if (params.type) queryParams.append("type", params.type); if (params.channel) queryParams.append("channel", params.channel.join(",")); const queryString = queryParams.toString() ? `?${queryParams.toString()}` : ""; const result = await novitaRequest(`/templates${queryString}`); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/novitalabs/novita-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server