Skip to main content
Glama

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
NameRequiredDescriptionDefault
proxyIdYesID of the TCP proxy to delete

Implementation Reference

  • 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)}`);
      }
    }
  • Zod input schema for the tcp_proxy_delete tool: requires proxyId as string.
    {
      proxyId: z.string().describe("ID of the TCP proxy to delete")
    },
  • 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);
      }
    )
  • 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;
    }

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