tcp_proxy_list
View and manage TCP proxy configurations for Railway services to control external access and audit network endpoints in specific environments.
Instructions
[API] List all TCP proxies for a service in a specific environment
⚡️ Best for: ✓ Viewing TCP proxy configurations ✓ Managing external access ✓ Auditing service endpoints
→ Prerequisites: service_list
→ Next steps: tcp_proxy_create
→ Related: domain_list, service_info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentId | Yes | ID of the environment containing the service | |
| serviceId | Yes | ID of the service to list TCP proxies for |
Implementation Reference
- src/tools/tcpProxy.tool.ts:6-29 (registration)Definition and registration preparation of the 'tcp_proxy_list' tool using createTool. Includes tool name, formatted description, input schema with environmentId and serviceId, and handler function that calls the service method.createTool( "tcp_proxy_list", formatToolDescription({ type: 'API', description: "List all TCP proxies for a service in a specific environment", bestFor: [ "Viewing TCP proxy configurations", "Managing external access", "Auditing service endpoints" ], relations: { prerequisites: ["service_list"], nextSteps: ["tcp_proxy_create"], related: ["domain_list", "service_info"] } }), { environmentId: z.string().describe("ID of the environment containing the service"), serviceId: z.string().describe("ID of the service to list TCP proxies for") }, async ({ environmentId, serviceId }) => { return tcpProxyService.listTcpProxies(environmentId, serviceId); } ),
- src/tools/tcpProxy.tool.ts:26-28 (handler)The handler function for the tcp_proxy_list tool, which invokes tcpProxyService.listTcpProxies with the provided environmentId and serviceId.async ({ environmentId, serviceId }) => { return tcpProxyService.listTcpProxies(environmentId, serviceId); }
- src/tools/tcpProxy.tool.ts:22-25 (schema)Zod schema defining the input parameters for the tcp_proxy_list tool: environmentId (string) and serviceId (string).{ environmentId: z.string().describe("ID of the environment containing the service"), serviceId: z.string().describe("ID of the service to list TCP proxies for") },
- src/tools/index.ts:32-36 (registration)Registration of all tools, including tcp_proxy_list from tcpProxyTools, by spreading into server.tool calls on the MCP server.allTools.forEach((tool) => { server.tool( ...tool ); });
- Helper method in TcpProxyService that implements the core logic for listing TCP proxies: fetches from client, formats response with details or empty message, handles errors.async listTcpProxies(environmentId: string, serviceId: string): Promise<CallToolResult> { try { const proxies = await this.client.tcpProxies.listTcpProxies(environmentId, serviceId); if (proxies.length === 0) { return createSuccessResponse({ text: 'No TCP proxies found for this service.', data: [] }); } const proxyDetails = proxies.map(proxy => `- Application Port: ${proxy.applicationPort} → Proxy Port: ${proxy.proxyPort} Domain: ${proxy.domain} ID: ${proxy.id}` ).join('\n\n'); return createSuccessResponse({ text: `TCP Proxies for this service:\n\n${proxyDetails}`, data: proxies }); } catch (error) { return createErrorResponse(`Error listing TCP proxies: ${formatError(error)}`); } }