Skip to main content
Glama

service_create_from_image

Create a Railway service from a Docker image to deploy custom databases, pre-built containers, or specific image versions.

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
projectIdYesID of the project to create the service in
imageYesDocker image to use (e.g., 'postgres:13-alpine')
nameNoOptional custom name for the service

Implementation Reference

  • Registration of the 'service_create_from_image' MCP tool, including description, input schema (zod), and handler function 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);
      }
    ),
  • Helper method in ServiceService that implements the core logic: calls client.services.createService with Docker image source and returns formatted response.
    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)}`);
      }
    }
Behavior3/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. It mentions 'Create' implying a write operation but lacks details on permissions, rate limits, or error handling. The 'Next steps' and 'Related' sections add some behavioral context (e.g., follow-up actions), but critical aspects like mutation effects or response format are missing, leaving gaps for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with sections like 'Best for', 'Not for', and bullet points for prerequisites and alternatives, making it easy to scan. It is front-loaded with the core purpose. However, some sections (e.g., 'Next steps', 'Related') could be trimmed as they are less critical, slightly reducing efficiency.

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?

Given no annotations and no output schema, the description does well by covering usage guidelines and distinguishing from siblings. It lacks details on behavioral traits (e.g., what 'Create' entails operationally) and output, but the structured sections compensate somewhat. For a mutation tool with 3 parameters, it is mostly complete but could improve on transparency.

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 parameters (projectId, image, name). The description does not add any parameter-specific details beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the description adds no extra semantic value for parameters.

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 creates a new service from a Docker image, using specific verbs ('Create') and resources ('service', 'Docker image'). It distinguishes from siblings like service_create_from_repo and database_deploy by explicitly naming them in the 'Not for' section, making the purpose specific and differentiated.

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, listing specific use cases (e.g., custom database deployments) and exclusions (e.g., not for standard database deployments). It names alternatives (database_deploy, service_create_from_repo) and prerequisites (project_list), offering comprehensive usage context.

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/epitaphe360/railway-mcp'

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