Skip to main content
Glama

domain_list

Retrieve and manage service and custom domain configurations using the domain_list tool on railway-mcp. Ideal for auditing, viewing endpoints, and updating domain settings efficiently.

Instructions

[API] List all domains (both service and custom) for a service

⚡️ Best for: ✓ Viewing service endpoints ✓ Managing domain configurations ✓ Auditing domain settings

→ Prerequisites: service_list

→ Next steps: domain_create, domain_update

→ Related: service_info, tcp_proxy_list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentIdYesID of the environment that the service is in to list domains from (usually obtained from service_list)
projectIdYesID of the project containing the service
serviceIdYesID of the service to list domains for

Implementation Reference

  • The handler function that implements the core logic of the 'domain_list' tool by calling domainService.listDomains with the required parameters.
    async ({ projectId, environmentId, serviceId }) => {
      return domainService.listDomains(projectId, environmentId, serviceId);
    }
  • Zod schema defining the input parameters for the 'domain_list' tool: projectId, environmentId, and serviceId.
    {
      projectId: z.string().describe("ID of the project containing the service"),
      environmentId: z.string().describe("ID of the environment that the service is in to list domains from (usually obtained from service_list)"),
      serviceId: z.string().describe("ID of the service to list domains for")
    },
  • The 'domain_list' tool is created and registered in the domainTools array using createTool, defining its name, description, input schema, and handler.
    createTool(
      "domain_list",
      formatToolDescription({
        type: 'API',
        description: "List all domains (both service and custom) for a service",
        bestFor: [
          "Viewing service endpoints",
          "Managing domain configurations",
          "Auditing domain settings"
        ],
        relations: {
          prerequisites: ["service_list"],
          nextSteps: ["domain_create", "domain_update"],
          related: ["service_info", "tcp_proxy_list"]
        }
      }),
      {
        projectId: z.string().describe("ID of the project containing the service"),
        environmentId: z.string().describe("ID of the environment that the service is in to list domains from (usually obtained from service_list)"),
        serviceId: z.string().describe("ID of the service to list domains for")
      },
      async ({ projectId, environmentId, serviceId }) => {
        return domainService.listDomains(projectId, environmentId, serviceId);
      }
    ),
  • Global registration of all tools, including 'domain_list' from domainTools, to the MCP server using 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
        );
      });
    } 

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