tcp_proxy_delete
Delete unused or insecure TCP proxies in the railway-mcp server to manage security and clean up endpoints. Requires proxy ID for removal. Use with tcp_proxy_list for efficient proxy management.
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/services/tcpProxy.service.ts:35-50 (handler)Executes the core logic for deleting a TCP proxy: calls the repository client, handles success/error responses with formatted text.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)}`); } }
- src/tools/tcpProxy.tool.ts:85-87 (schema)Zod input schema for the tcp_proxy_delete tool: requires proxyId as string.{ proxyId: z.string().describe("ID of the TCP proxy to delete") },
- src/tools/tcpProxy.tool.ts:66-91 (registration)Registers the tcp_proxy_delete tool using createTool: includes name, formatted description, input schema, and handler delegating to service.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); } )
- src/tools/index.ts:16-37 (registration)Global registration of all tools to MCP server, including tcpProxyTools which contains tcp_proxy_delete.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 ); }); }
- Repository helper: executes GraphQL mutation to delete TCP proxy via Railway API client.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; }