Skip to main content
Glama

service_create_from_image

Creates a new service on Railway using a specified Docker image, ideal for custom database setups or pre-built container deployments with specific version requirements.

Instructions

[API] Create a new service from a Docker image

⚡️ Best for: ✓ Custom database deployments ✓ Pre-built container deployments ✓ Specific version requirements

⚠️ Not for: × Standard database deployments (use database_deploy) × GitHub repository deployments (use service_create_from_repo) × Services needing build process

→ Prerequisites: project_list

→ Alternatives: database_deploy, service_create_from_repo

→ Next steps: variable_set, service_update, tcp_proxy_create

→ Related: volume_create, deployment_trigger

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYesDocker image to use (e.g., 'postgres:13-alpine')
nameNoOptional custom name for the service
projectIdYesID of the project to create the service in

Implementation Reference

  • Tool registration including description, input schema (Zod), and thin handler that delegates to serviceService.createServiceFromImage
    createTool( "service_create_from_image", formatToolDescription({ type: 'API', description: "Create a new service from a Docker image", bestFor: [ "Custom database deployments", "Pre-built container deployments", "Specific version requirements" ], notFor: [ "Standard database deployments (use database_deploy)", "GitHub repository deployments (use service_create_from_repo)", "Services needing build process" ], relations: { prerequisites: ["project_list"], nextSteps: ["variable_set", "service_update", "tcp_proxy_create"], alternatives: ["database_deploy", "service_create_from_repo"], related: ["volume_create", "deployment_trigger"] } }), { projectId: z.string().describe("ID of the project to create the service in"), image: z.string().describe("Docker image to use (e.g., 'postgres:13-alpine')"), name: z.string().optional().describe("Optional custom name for the service") }, async ({ projectId, image, name }) => { return serviceService.createServiceFromImage(projectId, image, name); } ),
  • Main handler function implementing service creation from Docker image using the Railway client API, with error handling and response formatting.
    async createServiceFromImage(projectId: string, image: string, name?: string) { try { const service = await this.client.services.createService({ projectId, name, source: { image, } }); return createSuccessResponse({ text: `Created new service "${service.name}" (ID: ${service.id}) from Docker image "${image}"`, data: service }); } catch (error) { return createErrorResponse(`Error creating service: ${formatError(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/jason-tan-swe/railway-mcp'

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