Skip to main content
Glama

service_create_from_repo

Deploy applications directly from GitHub repositories using this tool. Ideal for projects requiring build processes, it simplifies service creation within specified projects, ensuring efficient deployment workflows.

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

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "name": { "description": "Optional custom name for the service", "type": "string" }, "projectId": { "description": "ID of the project to create the service in", "type": "string" }, "repo": { "description": "GitHub repository URL or name (e.g., 'owner/repo')", "type": "string" } }, "required": [ "projectId", "repo" ], "type": "object" }

Implementation Reference

  • Registration of the service_create_from_repo tool using createTool function, including description, schema, and handler function that calls the service service.
    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); } ),
  • Core handler logic for creating a service from a GitHub repository using the Railway client API.
    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)}`); } }
  • Zod input schema defining parameters: projectId, repo, and optional name.
    { 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") },
  • Global registration of all tools, including serviceTools containing service_create_from_repo, to the MCP server.
    export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server 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/jason-tan-swe/railway-mcp'

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