view_policy
Retrieve details of an existing Lemonade insurance policy by providing your email address and policy ID to access coverage information and documents.
Instructions
View details of an existing Lemonade insurance policy
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policy_id | No | The policy ID to retrieve | |
| Yes | Email address associated with the policy |
Implementation Reference
- src/index.ts:263-294 (handler)The handler function that implements the logic for 'view_policy'.
async function handleViewPolicy(args: { policy_id?: string; email: string; }): Promise<string> { return withBrowser(async (browser, page) => { await page.goto(`${LEMONADE_BASE_URL}/login`, { waitUntil: "domcontentloaded", timeout: 30000, }); await page.waitForTimeout(1500); const title = await page.title(); return JSON.stringify({ status: "action_required", message: "To view your policy, you need to log in to your Lemonade account.", login_url: `${LEMONADE_BASE_URL}/login`, email: args.email, policy_id: args.policy_id || "Not provided", instructions: [ `1. Visit ${LEMONADE_BASE_URL}/login`, `2. Sign in with your email: ${args.email}`, "3. Navigate to 'My Policy' to view your policy details", args.policy_id ? `4. Look for policy ID: ${args.policy_id}` : "4. Select your policy from the list", ], page_title: title, }); }); } - src/index.ts:42-56 (registration)Registration of the 'view_policy' tool with its input schema.
{ name: "view_policy", description: "View details of an existing Lemonade insurance policy", inputSchema: { type: "object", properties: { policy_id: { type: "string", description: "The policy ID to retrieve", }, email: { type: "string", description: "Email address associated with the policy", }, },