get_page_html
Retrieve the raw HTML content of a specific page on a website by providing the website and page IDs.
Instructions
Get the HTML content of a page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| website_id | Yes | The website ID | |
| page_id | Yes | The page ID |
Implementation Reference
- server/index.js:586-598 (registration)Registration and handler for the 'get_page_html' tool. Registered via server.tool() with schema (website_id, page_id) and handler that makes a GET API call to retrieve the HTML content of a page.
server.tool( "get_page_html", "Get the HTML content of a page.", { website_id: z.string().describe("The website ID"), page_id: z.string().describe("The page ID"), }, { title: "Get Page HTML", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ website_id, page_id }) => { const data = await apiCall(`/v1/workspace/website/${website_id}/pages/${page_id}/html`, "GET"); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } ); - server/index.js:589-592 (schema)Input schema for get_page_html: requires website_id and page_id as strings.
{ website_id: z.string().describe("The website ID"), page_id: z.string().describe("The page ID"), }, - server/index.js:594-597 (handler)The handler function that calls the API endpoint to fetch the HTML content of the specified page and returns it as text content.
async ({ website_id, page_id }) => { const data = await apiCall(`/v1/workspace/website/${website_id}/pages/${page_id}/html`, "GET"); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } - server/index.js:112-123 (helper)Helper function for making authenticated API calls to the Lindo AI backend.
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(); }