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)}`);
      }
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden. It effectively communicates this is a creation/mutation tool (implied by 'Create'), mentions prerequisites, and suggests next steps. However, it doesn't explicitly address permissions, rate limits, or error conditions that would be helpful for a mutation tool.

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 well-structured with clear sections (purpose, best for, not for, prerequisites, alternatives, next steps, related). Every sentence earns its place by providing actionable guidance without redundancy.

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 creation tool with no annotations and no output schema, the description does an excellent job covering usage context, alternatives, and workflow. It could be more complete by explicitly stating this is a mutation operation and mentioning typical response format, but it provides substantial guidance for tool selection.

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 description coverage is 100%, so the schema already documents all three parameters. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 explicitly states 'Create a new service from a Docker image' - a specific verb ('Create') and resource ('service') with clear scope ('from a Docker image'). It distinguishes from siblings like 'service_create_from_repo' and 'database_deploy' by specifying the image-based approach.

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

Usage Guidelines5/5

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

The description provides explicit guidance with 'Best for' and 'Not for' sections, naming specific alternatives ('database_deploy', 'service_create_from_repo') and prerequisites ('project_list'). It clearly defines when to use this tool versus other options.

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

Related 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/jason-tan-swe/railway-mcp'

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