tcp_proxy_delete
Remove a TCP proxy from your Railway infrastructure to clean up unused endpoints or manage security by deleting specific proxy configurations.
Instructions
[API] Delete a TCP proxy
⚡️ Best for: ✓ Removing unused proxies ✓ Security management ✓ Endpoint cleanup
⚠️ Not for: × Temporary proxy disabling × Port updates
→ Prerequisites: tcp_proxy_list
→ Related: service_update
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| proxyId | Yes | ID of the TCP proxy to delete |
Implementation Reference
- src/tools/tcpProxy.tool.ts:88-90 (handler)MCP tool handler for 'tcp_proxy_delete' that receives proxyId and calls tcpProxyService.deleteTcpProxy(proxyId). This is the primary execution logic for the tool.async ({ proxyId }) => { return tcpProxyService.deleteTcpProxy(proxyId); }
- src/tools/tcpProxy.tool.ts:85-87 (schema)Input schema for tcp_proxy_delete tool using Zod, requiring a single proxyId string parameter.{ proxyId: z.string().describe("ID of the TCP proxy to delete") },
- src/tools/index.ts:16-37 (registration)Registration of all MCP tools to the McpServer, including tcp_proxy_delete via inclusion in tcpProxyTools (spread at line 24).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 ); }); }
- TCP proxy service delete method called by the tool handler, which invokes the repository and handles response/error formatting.async deleteTcpProxy(id: string): Promise<CallToolResult> { try { const result = await this.client.tcpProxies.tcpProxyDelete(id); if (result) { return createSuccessResponse({ text: `TCP Proxy with ID ${id} deleted successfully`, data: { success: true } }); } else { return createErrorResponse(`Failed to delete TCP Proxy with ID ${id}`); } } catch (error) { return createErrorResponse(`Error deleting TCP proxy: ${formatError(error)}`); } }
- Repository method performing the GraphQL mutation to delete the TCP proxy.async tcpProxyDelete(id: string): Promise<boolean> { const query = ` mutation tcpProxyDelete($id: String!) { tcpProxyDelete(id: $id) } `; const variables = { id }; const response = await this.client.request<{ tcpProxyDelete: boolean }>(query, variables); return response.tcpProxyDelete; }