Skip to main content
Glama
runpod

RunPod MCP Server

Official
by runpod

endpoint-health

Check the health and operational status of a serverless endpoint, including worker counts and job statistics, to monitor performance and availability.

Instructions

Get the health and operational status of a Serverless endpoint, including worker counts and job statistics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointIdYesID of the Serverless endpoint to check health for

Implementation Reference

  • src/index.ts:1019-1038 (registration)
    Registration of the 'endpoint-health' tool via server.tool() on the MCP server. Defines tool name, description, input schema (endpointId), and handler.
    // Endpoint Health
    server.tool(
      'endpoint-health',
      'Get the health and operational status of a Serverless endpoint, including worker counts and job statistics.',
      {
        endpointId: endpointIdSchema.describe('ID of the Serverless endpoint to check health for'),
      },
      async (params) => {
        const result = await serverlessRequest(params.endpointId, '/health');
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • Handler function for endpoint-health tool. Calls serverlessRequest with the given endpointId and '/health' path, returns the JSON result as text content.
    async (params) => {
      const result = await serverlessRequest(params.endpointId, '/health');
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Zod schema for endpointId, a string matching alphanumeric characters, hyphens, and underscores.
    const endpointIdSchema = z
      .string()
      .regex(/^[a-zA-Z0-9_-]+$/, 'Invalid endpoint ID format');
  • Helper function that makes authenticated HTTP requests to the RunPod Serverless API. Used by endpoint-health to call the /health endpoint.
    async function serverlessRequest(
      endpointId: string,
      path: string,
      method: string = 'GET',
      body?: Record<string, unknown>
    ) {
      const url = `${SERVERLESS_API_BASE_URL}/${endpointId}${path}`;
      const headers: Record<string, string> = {
        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 Serverless API Error: ${response.status} - ${errorText}`
          );
        }
    
        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 Serverless API:', error);
        throw error;
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It implies a read operation but does not mention safety, potential side effects, rate limits, or prerequisites.

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?

A single sentence with 17 words that is front-loaded and to the point. Every word is necessary, with no fluff.

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?

The description covers the endpoint ID parameter and mentions return contents (health, worker counts, job statistics). For a simple health check tool with one parameter and no nested objects, it is fairly complete, though missing behavioral transparency lowers it from a perfect score.

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?

The schema covers the single parameter fully (description and pattern). The tool description adds the context 'Serverless endpoint' but does not add meaning beyond the schema details. Baseline 3 is appropriate given 100% coverage.

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?

The description clearly states the tool gets health and operational status of a Serverless endpoint, including specific details like worker counts and job statistics. This distinguishes it from siblings like get-endpoint (general info) and list-endpoints (listing).

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives such as get-endpoint or run-endpoint. The description only states what it does without context for selection.

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