Skip to main content
Glama
runpod

RunPod MCP Server

Official
by runpod

get-job-status

Check the status of an asynchronous serverless job. Returns current status and output when complete. Supports statuses: IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED, TIMED_OUT.

Instructions

Check the status of an asynchronous Serverless job. Returns the current status and output when complete. Job statuses: IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED, TIMED_OUT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointIdYesID of the Serverless endpoint the job belongs to
jobIdYesID of the job to check

Implementation Reference

  • src/index.ts:868-891 (registration)
    Registration of the 'get-job-status' tool with its description and input schema (endpointId + jobId).
    // Get Job Status
    server.tool(
      'get-job-status',
      'Check the status of an asynchronous Serverless job. Returns the current status and output when complete. Job statuses: IN_QUEUE, IN_PROGRESS, COMPLETED, FAILED, CANCELLED, TIMED_OUT.',
      {
        endpointId: endpointIdSchema.describe('ID of the Serverless endpoint the job belongs to'),
        jobId: jobIdSchema.describe('ID of the job to check'),
      },
      async (params) => {
        const result = await serverlessRequest(
          params.endpointId,
          `/status/${params.jobId}`
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • Handler function that calls serverlessRequest to GET /status/{jobId} and returns the JSON result.
      async (params) => {
        const result = await serverlessRequest(
          params.endpointId,
          `/status/${params.jobId}`
        );
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      }
    );
  • Zod schema for jobId validation (alphanumeric string with hyphens/underscores).
    const jobIdSchema = z
      .string()
      .regex(/^[a-zA-Z0-9_-]+$/, 'Invalid job ID format');
  • Zod schema for endpointId validation (alphanumeric string with hyphens/underscores).
    const endpointIdSchema = z
      .string()
      .regex(/^[a-zA-Z0-9_-]+$/, 'Invalid endpoint ID format');
  • Helper function serverlessRequest that makes authenticated HTTP requests to the RunPod Serverless API (base URL: https://api.runpod.ai/v2). Used by get-job-status to call GET /status/{jobId}.
    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;
      }
    }
Behavior4/5

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

No annotations are provided, so the description must disclose behavioral traits. It notes the job is asynchronous, lists possible statuses (IN_QUEUE, IN_PROGRESS, etc.), and mentions that output is returned when complete. This adds value beyond the schema and is accurate.

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?

The description is two sentences long, front-loaded with the core purpose, and no extraneous information. Every word contributes meaning.

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

Completeness3/5

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

The description covers the status return and output, but lacks details on the response format or error conditions. Given no output schema, it is moderately complete but leaves gaps for an agent understanding the full response structure.

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 clear parameter descriptions for endpointId and jobId. The description does not add further semantic details beyond stating it's a Serverless job. Baseline 3 is appropriate as the schema already does the work.

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 uses a specific verb 'Check' and resource 'status of an asynchronous Serverless job'. It clearly distinguishes from sibling tools like cancel-job and retry-job, which perform different actions. The purpose is unambiguous.

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?

The description states 'Check the status of an asynchronous Serverless job', implying it should be used after starting such a job to poll for completion. It does not explicitly exclude scenarios or mention siblings, but the context is clear enough for an agent to decide.

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