tcp_proxy_delete
Delete a TCP proxy from Railway infrastructure to remove unused proxies, manage security, and perform endpoint cleanup. Use this tool for permanent proxy removal.
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)The handler function that executes the tcp_proxy_delete tool logic by calling tcpProxyService.deleteTcpProxy(proxyId).async ({ proxyId }) => { return tcpProxyService.deleteTcpProxy(proxyId); }
- src/tools/tcpProxy.tool.ts:85-87 (schema)Input schema using Zod for the tcp_proxy_delete tool, requiring a proxyId string.{ proxyId: z.string().describe("ID of the TCP proxy to delete") },
- src/tools/tcpProxy.tool.ts:66-91 (registration)Registration of the tcp_proxy_delete tool using createTool, including description, schema, and handler.createTool( "tcp_proxy_delete", formatToolDescription({ type: 'API', description: "Delete a TCP proxy", bestFor: [ "Removing unused proxies", "Security management", "Endpoint cleanup" ], notFor: [ "Temporary proxy disabling", "Port updates" ], relations: { prerequisites: ["tcp_proxy_list"], related: ["service_update"] } }), { proxyId: z.string().describe("ID of the TCP proxy to delete") }, async ({ proxyId }) => { return tcpProxyService.deleteTcpProxy(proxyId); } )
- Helper service method deleteTcpProxy that wraps the repository call and handles responses/errors.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 helper that executes 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; }