login
Authenticate to access Rover pet services, enabling pet sitter searches, booking management, and profile handling through secure email and password verification.
Instructions
Log in to Rover with your email and password. Required before most operations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Yes | Your Rover account email address | ||
| password | Yes | Your Rover account password |
Implementation Reference
- src/index.ts:382-395 (handler)Handler for the 'login' tool - validates input using LoginSchema, calls browser.login() method, and returns success/failure message based on session state
case "login": { const { email, password } = LoginSchema.parse(args); const session = await browser.login(email, password); return { content: [ { type: "text", text: session.isLoggedIn ? `Successfully logged in as ${session.email}.` : "Login failed. Please check your credentials.", }, ], }; } - src/index.ts:294-297 (schema)Zod validation schema for login inputs - validates email format and requires non-empty password
const LoginSchema = z.object({ email: z.string().email(), password: z.string().min(1), }); - src/browser.ts:3-7 (schema)Type definition for RoverSession interface returned by login - contains isLoggedIn boolean and optional userId/email fields
export interface RoverSession { isLoggedIn: boolean; userId?: string; email?: string; } - src/index.ts:25-36 (registration)Tool registration defining 'login' with name, description, and JSON Schema input schema for MCP protocol
{ name: "login", description: "Log in to Rover with your email and password. Required before most operations.", inputSchema: { type: "object", properties: { email: { type: "string", description: "Your Rover account email address" }, password: { type: "string", description: "Your Rover account password" }, }, required: ["email", "password"], }, }, - src/browser.ts:133-158 (helper)Browser automation helper that navigates to login page, fills credentials, submits form, and verifies successful login by checking URL changes
async login(email: string, password: string): Promise<RoverSession> { const page = this.ensurePage(); await page.goto(`${this.BASE_URL}/login/`); await page.waitForLoadState("networkidle"); await page.fill('input[name="email"], input[type="email"]', email); await page.fill('input[name="password"], input[type="password"]', password); await page.click('button[type="submit"], input[type="submit"]'); await page.waitForLoadState("networkidle"); const url = page.url(); const loggedIn = !url.includes("/login") && !url.includes("/signin") && (url.includes("/dashboard") || url.includes("/account") || url === `${this.BASE_URL}/` || !url.includes("login")); this.session = { isLoggedIn: loggedIn, email: loggedIn ? email : undefined, }; return this.session; }