Skip to main content
Glama

service_create_from_repo

Deploy applications from GitHub repositories by creating services with build processes. Specify project ID and repository URL to initiate deployment.

Instructions

[API] Create a new service from a GitHub repository

⚡️ Best for: ✓ Deploying applications from source code ✓ Services that need build processes ✓ GitHub-hosted projects

⚠️ Not for: × Pre-built Docker images (use service_create_from_image) × Database deployments (use database_deploy) × Static file hosting

→ Prerequisites: project_list

→ Alternatives: service_create_from_image, database_deploy

→ Next steps: variable_set, service_update

→ Related: deployment_trigger, service_info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesID of the project to create the service in
repoYesGitHub repository URL or name (e.g., 'owner/repo')
nameNoOptional custom name for the service

Implementation Reference

  • Tool definition, registration in serviceTools array, input schema (Zod), formatted description, and inline handler function delegating to serviceService
    createTool( "service_create_from_repo", formatToolDescription({ type: 'API', description: "Create a new service from a GitHub repository", bestFor: [ "Deploying applications from source code", "Services that need build processes", "GitHub-hosted projects" ], notFor: [ "Pre-built Docker images (use service_create_from_image)", "Database deployments (use database_deploy)", "Static file hosting" ], relations: { prerequisites: ["project_list"], nextSteps: ["variable_set", "service_update"], alternatives: ["service_create_from_image", "database_deploy"], related: ["deployment_trigger", "service_info"] } }), { projectId: z.string().describe("ID of the project to create the service in"), repo: z.string().describe("GitHub repository URL or name (e.g., 'owner/repo')"), name: z.string().optional().describe("Optional custom name for the service") }, async ({ projectId, repo, name }) => { return serviceService.createServiceFromRepo(projectId, repo, name); } ),
  • The MCP tool handler function that extracts parameters and calls the service service method
    async ({ projectId, repo, name }) => { return serviceService.createServiceFromRepo(projectId, repo, name); }
  • Core helper method in ServiceService that invokes the Railway client API to create a service from a GitHub repository
    async createServiceFromRepo(projectId: string, repo: string, name?: string) { try { const service = await this.client.services.createService({ projectId, name, source: { repo, } }); return createSuccessResponse({ text: `Created new service "${service.name}" (ID: ${service.id}) from GitHub repo "${repo}"`, data: service }); } catch (error) { return createErrorResponse(`Error creating service: ${formatError(error)}`); } }
  • Final MCP server registration where serviceTools (including service_create_from_repo) is spread into allTools and each tool is registered via server.tool
    allTools.forEach((tool) => { server.tool( ...tool ); });

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