Skip to main content
Glama
novitalabs

Novita MCP Server

Official
by novitalabs

list-templates

Retrieve paginated lists of instance or serverless templates from private, community, or official channels for efficient resource management on the Novita MCP Server.

Input Schema

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

Implementation Reference

  • Inline asynchronous handler function for the 'list-templates' tool. It constructs URL query parameters based on input (pageSize, pageNum, type, channel), fetches data from the '/templates' endpoint using novitaRequest, and returns the result as a text content block with JSON stringification.
    }, 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-based input schema definition for the 'list-templates' tool, defining optional parameters for pagination (pageSize, pageNum), filtering by type (instance/serverless), and channel (private/community/official as array).
    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' tool on the MCP server within registerTemplateTools function, including inline schema validation and handler implementation.
    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