Skip to main content
Glama

service_create_from_repo

Deploy applications by creating services from GitHub repositories, enabling automated builds and deployments for source code projects.

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

  • The MCP tool handler function that executes the tool logic by calling serviceService.createServiceFromRepo.
    async ({ projectId, repo, name }) => {
      return serviceService.createServiceFromRepo(projectId, repo, name);
    }
  • Input schema using Zod defining the required parameters for the tool.
    {
      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")
    },
  • Tool definition and local registration using createTool function, including name, description, schema, and handler.
    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);
      }
    ),
  • Supporting method in serviceService that performs the actual API call to create service from repo using the client.
    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)}`);
      }
    }
  • Global registration where serviceTools (including service_create_from_repo) is spread into allTools and each tool registered with the MCP server via server.tool.
    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
        );
      });

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Description mentions it's an API call and requires prerequisite project_list, but doesn't detail potential side effects (e.g., costs, permissions, rebuild times). No annotations provided to compensate.

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?

Well-structured with sections, emojis, and arrows for clarity. Some redundancy in arrows, but overall efficient and front-loaded.

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?

Covers prerequisites, alternatives, and next steps. Missing output schema and error handling, but for a creation tool it's fairly complete.

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 covers 100% of parameters with descriptions. Description adds no extra parameter-level detail beyond what schema already provides.

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 'Create a new service from a GitHub repository', specifying the action (create), resource (service), and source (GitHub repo). It distinguishes from siblings like service_create_from_image and database_deploy.

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?

Explicit sections for 'Best for', 'Not for', prerequisites, alternatives, next steps, and related tools provide comprehensive guidance on when to use and avoid this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.