Add Custom Domain
add_custom_domainAdd a custom domain to a website by providing the website ID and domain name.
Instructions
Add a custom domain to a website.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| website_id | Yes | The website ID | |
| domain | Yes | Custom domain to add |
Implementation Reference
- server/index.js:465-468 (handler)The async handler function that executes the 'add_custom_domain' tool logic. It calls the Lindo API (POST /v1/workspace/website/{website_id}/domain) with the domain payload and returns the result.
async ({ website_id, domain }) => { const data = await apiCall(`/v1/workspace/website/${website_id}/domain`, "POST", { domain }); return { content: [{ type: "text", text: JSON.stringify(data?.result ?? data, null, 2) }] }; } - server/index.js:459-462 (schema)Input schema/validation for the tool, defining website_id (string) and domain (string) as required parameters using Zod.
inputSchema: { website_id: z.string().describe("The website ID"), domain: z.string().describe("Custom domain to add"), }, - server/index.js:454-469 (registration)Registration of the 'add_custom_domain' tool using server.registerTool(), including its title, description, input schema, annotations, and handler.
server.registerTool( "add_custom_domain", { title: "Add Custom Domain", description: "Add a custom domain to a website.", inputSchema: { website_id: z.string().describe("The website ID"), domain: z.string().describe("Custom domain to add"), }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false }, }, async ({ website_id, domain }) => { const data = await apiCall(`/v1/workspace/website/${website_id}/domain`, "POST", { domain }); return { content: [{ type: "text", text: JSON.stringify(data?.result ?? data, null, 2) }] }; } ); - server/index.js:112-123 (helper)The apiCall helper function used by the handler to make authenticated HTTP requests to the Lindo API with a Bearer token.
async function apiCall(path, method, body) { const url = `${BASE_URL}${path}`; const res = await fetch(url, { method, headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json", }, ...(body ? { body: JSON.stringify(body) } : {}), }); return res.json(); }