Skip to main content
Glama

create-container-registry-auth

Generate authentication credentials for private container registries to enable secure image pulls in RunPod deployments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesName for the container registry auth
usernameYesRegistry username
passwordYesRegistry password

Implementation Reference

  • Handler function that executes the tool by making an authenticated POST request to RunPod's /containerregistryauth endpoint with name, username, and password.
    async (params) => { const result = await runpodRequest( '/containerregistryauth', 'POST', params ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Input schema defined using Zod for validating the tool parameters: name, username, and password.
    { name: z.string().describe('Name for the container registry auth'), username: z.string().describe('Registry username'), password: z.string().describe('Registry password'), },
  • src/index.ts:781-804 (registration)
    Registration of the 'create-container-registry-auth' tool on the MCP server using server.tool(), specifying name, input schema, and handler function.
    server.tool( 'create-container-registry-auth', { name: z.string().describe('Name for the container registry auth'), username: z.string().describe('Registry username'), password: z.string().describe('Registry password'), }, async (params) => { const result = await runpodRequest( '/containerregistryauth', 'POST', params ); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; } );
  • Shared helper function used by the handler (and other tools) to make authenticated API requests to the RunPod service.
    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; } }

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