Skip to main content
Glama
runpod

RunPod MCP Server

Official
by runpod

list-templates

List templates: view your own by default, or include official RunPod, public community, or endpoint-bound templates.

Instructions

List available templates. By default returns only the user's own templates. Use includeRunpodTemplates to also include official RunPod templates. The recommended default template for new pods is "Runpod Pytorch 2.8.0" (ID: runpod-torch-v280) — it has the latest CUDA and PyTorch versions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeRunpodTemplatesNoInclude official RunPod templates in the response
includePublicTemplatesNoInclude community-made public templates in the response
includeEndpointBoundTemplatesNoInclude templates bound to Serverless endpoints in the response

Implementation Reference

  • src/index.ts:1068-1107 (registration)
    Registration of the 'list-templates' tool via server.tool() — includes both schema and handler inline.
    server.tool(
      'list-templates',
      'List available templates. By default returns only the user\'s own templates. Use includeRunpodTemplates to also include official RunPod templates. The recommended default template for new pods is "Runpod Pytorch 2.8.0" (ID: runpod-torch-v280) — it has the latest CUDA and PyTorch versions.',
      {
        includeRunpodTemplates: z
          .boolean()
          .optional()
          .describe('Include official RunPod templates in the response'),
        includePublicTemplates: z
          .boolean()
          .optional()
          .describe('Include community-made public templates in the response'),
        includeEndpointBoundTemplates: z
          .boolean()
          .optional()
          .describe(
            'Include templates bound to Serverless endpoints in the response'
          ),
      },
      async (params) => {
        const queryParams = new URLSearchParams();
        if (params.includeRunpodTemplates)
          queryParams.set('includeRunpodTemplates', 'true');
        if (params.includePublicTemplates)
          queryParams.set('includePublicTemplates', 'true');
        if (params.includeEndpointBoundTemplates)
          queryParams.set('includeEndpointBoundTemplates', 'true');
        const query = queryParams.toString();
        const result = await runpodRequest(`/templates${query ? `?${query}` : ''}`);
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • Zod schema defining the three optional boolean input parameters for list-templates.
    {
      includeRunpodTemplates: z
        .boolean()
        .optional()
        .describe('Include official RunPod templates in the response'),
      includePublicTemplates: z
        .boolean()
        .optional()
        .describe('Include community-made public templates in the response'),
      includeEndpointBoundTemplates: z
        .boolean()
        .optional()
        .describe(
          'Include templates bound to Serverless endpoints in the response'
        ),
    },
  • Handler function: builds query params from schema, calls runpodRequest to GET /templates, and returns JSON result as text content.
    async (params) => {
      const queryParams = new URLSearchParams();
      if (params.includeRunpodTemplates)
        queryParams.set('includeRunpodTemplates', 'true');
      if (params.includePublicTemplates)
        queryParams.set('includePublicTemplates', 'true');
      if (params.includeEndpointBoundTemplates)
        queryParams.set('includeEndpointBoundTemplates', 'true');
      const query = queryParams.toString();
      const result = await runpodRequest(`/templates${query ? `?${query}` : ''}`);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Helper function used by the handler to make authenticated HTTP requests to the RunPod REST API.
    async function runpodRequest(
      endpoint: string,
      method: string = 'GET',
      body?: Record<string, unknown>
    ) {
      const url = `${API_BASE_URL}${endpoint}`;
      const headers = {
        Authorization: `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
      };
    
      const options: NodeFetchRequestInit = {
        method,
        headers,
      };
    
      if (body && (method === 'POST' || method === 'PATCH')) {
        options.body = JSON.stringify(body);
      }
    
      try {
        const response = await fetch(url, options);
    
        if (!response.ok) {
          const errorText = await response.text();
          throw new Error(`RunPod API Error: ${response.status} - ${errorText}`);
        }
    
        // Some endpoints might not return JSON
        const contentType = response.headers.get('content-type');
        if (contentType && contentType.includes('application/json')) {
          return await response.json();
        }
    
        return { success: true, status: response.status };
      } catch (error) {
        console.error('Error calling RunPod API:', error);
        throw error;
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It explains default filtering and a flag to include official templates, but does not disclose authentication, rate limits, or return format. Adds some useful behavioral context but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences: purpose, default behavior with flag usage, and a specific recommendation. No wasted words, front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with no output schema, description covers purpose, default filtering, and parameter guidance (one param). It provides a concrete template ID for convenience. Missing details like return structure, but sufficient for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all three boolean parameters. The description adds extra context for includeRunpodTemplates (recommended default template) but does not mention includePublicTemplates or includeEndpointBoundTemplates. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'List available templates' – a specific verb and resource. It distinguishes itself from sibling tools like create-template, update-template, delete-template, and get-template, which all have different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description explains default behavior (user's own templates) and how to include official templates via includeRunpodTemplates. It does not explicitly mention when not to use or alternatives for single templates, but the use case is straightforward.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/runpod/runpod-mcp-ts'

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