delete_subdomain
Release a custom subdomain to stop serving content. Removes subdomain from the run402 server infrastructure.
Instructions
Release a custom subdomain. The URL will stop serving content.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Subdomain name to release (e.g. 'myapp') | |
| project_id | No | Optional project ID for ownership verification. Uses stored service_key for auth. |
Implementation Reference
- src/tools/subdomain.ts:76-98 (handler)The handleDeleteSubdomain function executes the delete_subdomain tool logic. It takes a subdomain name and optional project_id, constructs an auth header if project_id is provided, makes a DELETE request to /v1/subdomains/{name}, and returns a confirmation message on success.
export async function handleDeleteSubdomain(args: { name: string; project_id?: string; }): Promise<{ content: Array<{ type: "text"; text: string }>; isError?: boolean }> { let authHeader: Record<string, string> = {}; if (args.project_id) { const project = getProject(args.project_id); if (!project) return projectNotFound(args.project_id); authHeader = { Authorization: `Bearer ${project.service_key}` }; } const res = await apiRequest(`/v1/subdomains/${encodeURIComponent(args.name)}`, { method: "DELETE", headers: authHeader, }); if (!res.ok) return formatApiError(res, "deleting subdomain"); return { content: [{ type: "text", text: `## Subdomain Released\n\nSubdomain \`${args.name}\` has been deleted. The URL \`https://${args.name}.run402.com\` is no longer active.` }], }; } - src/tools/subdomain.ts:66-74 (schema)The deleteSubdomainSchema defines the input validation schema for the delete_subdomain tool. It requires a 'name' (subdomain name to release) and an optional 'project_id' for ownership verification.
export const deleteSubdomainSchema = { name: z .string() .describe("Subdomain name to release (e.g. 'myapp')"), project_id: z .string() .optional() .describe("Optional project ID for ownership verification. Uses stored service_key for auth."), }; - src/index.ts:213-218 (registration)Registration of the 'delete_subdomain' tool with the MCP server. Links the tool name, description ('Release a custom subdomain. The URL will stop serving content.'), schema, and handler function.
server.tool( "delete_subdomain", "Release a custom subdomain. The URL will stop serving content.", deleteSubdomainSchema, async (args) => handleDeleteSubdomain(args), );