update_content_site
Modify content site details including contact information, address, URLs, and other operational data for staging environments.
Instructions
Update staging site information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| addressLine1 | No | Content Site Address Line 1 | |
| addressLine2 | No | Content Site Address Line 2 | |
| billingEmail | No | Content Site Billing Email | |
| city | No | Content Site City | |
| contactEmail | No | Content Site Contact Email | |
| contentSiteId | Yes | Content Site ID | |
| country | No | Content Site Country | |
| name | No | Content Site Name | |
| postalCode | No | Content Site Postal Code | |
| productionUrl | No | Content Site Production URL | |
| repoUrl | No | Content Site Repository URL | |
| state | No | Content Site State |
Implementation Reference
- src/index.ts:869-906 (handler)The handler function for 'update_content_site' tool. It constructs a payload from optional input parameters and sends a PUT request to the Headlesshost API endpoint `/tools/content-sites/${contentSiteId}` to update the content site details.async ({ contentSiteId, name, contactEmail, billingEmail, addressLine1, addressLine2, city, state, country, postalCode, productionUrl, repoUrl }) => { try { const payload: any = {}; if (name) payload.name = name; if (contactEmail) payload.contactEmail = contactEmail; if (billingEmail) payload.billingEmail = billingEmail; if (addressLine1) payload.addressLine1 = addressLine1; if (addressLine2) payload.addressLine2 = addressLine2; if (city) payload.city = city; if (state) payload.state = state; if (country) payload.country = country; if (postalCode) payload.postalCode = postalCode; if (productionUrl) payload.productionUrl = productionUrl; if (repoUrl) payload.repoUrl = repoUrl; const response: AxiosResponse<ApiResponse> = await apiClient.put(`/tools/content-sites/${contentSiteId}`, payload); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } } );
- src/index.ts:851-867 (schema)The input schema and metadata (title, description) for the 'update_content_site' tool, defining optional fields for updating content site properties using Zod validation.{ title: "Update Staging Site", description: "Update staging site information", inputSchema: { contentSiteId: z.string().describe("Content Site ID"), name: z.string().optional().describe("Content Site Name"), contactEmail: z.string().optional().describe("Content Site Contact Email"), billingEmail: z.string().optional().describe("Content Site Billing Email"), addressLine1: z.string().optional().describe("Content Site Address Line 1"), addressLine2: z.string().optional().describe("Content Site Address Line 2"), city: z.string().optional().describe("Content Site City"), state: z.string().optional().describe("Content Site State"), country: z.string().optional().describe("Content Site Country"), postalCode: z.string().optional().describe("Content Site Postal Code"), productionUrl: z.string().optional().describe("Content Site Production URL"), repoUrl: z.string().optional().describe("Content Site Repository URL"), },
- src/index.ts:849-906 (registration)The registration of the 'update_content_site' tool using server.registerTool, including schema, title, description, and the handler function.server.registerTool( "update_content_site", { title: "Update Staging Site", description: "Update staging site information", inputSchema: { contentSiteId: z.string().describe("Content Site ID"), name: z.string().optional().describe("Content Site Name"), contactEmail: z.string().optional().describe("Content Site Contact Email"), billingEmail: z.string().optional().describe("Content Site Billing Email"), addressLine1: z.string().optional().describe("Content Site Address Line 1"), addressLine2: z.string().optional().describe("Content Site Address Line 2"), city: z.string().optional().describe("Content Site City"), state: z.string().optional().describe("Content Site State"), country: z.string().optional().describe("Content Site Country"), postalCode: z.string().optional().describe("Content Site Postal Code"), productionUrl: z.string().optional().describe("Content Site Production URL"), repoUrl: z.string().optional().describe("Content Site Repository URL"), }, }, async ({ contentSiteId, name, contactEmail, billingEmail, addressLine1, addressLine2, city, state, country, postalCode, productionUrl, repoUrl }) => { try { const payload: any = {}; if (name) payload.name = name; if (contactEmail) payload.contactEmail = contactEmail; if (billingEmail) payload.billingEmail = billingEmail; if (addressLine1) payload.addressLine1 = addressLine1; if (addressLine2) payload.addressLine2 = addressLine2; if (city) payload.city = city; if (state) payload.state = state; if (country) payload.country = country; if (postalCode) payload.postalCode = postalCode; if (productionUrl) payload.productionUrl = productionUrl; if (repoUrl) payload.repoUrl = repoUrl; const response: AxiosResponse<ApiResponse> = await apiClient.put(`/tools/content-sites/${contentSiteId}`, payload); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: handleApiError(error), }, ], isError: true, }; } } );
- src/index.ts:87-95 (schema)TypeScript interface defining the structure of a ContentSite entity, used in API responses for the update_content_site tool.interface ContentSite { id: string; name: string; description?: string; accountId: string; isActive: boolean; createdAt: string; updatedAt: string; }