update_pet_profile
Modify pet profile details including size, temperament, special needs, and health information to maintain accurate care records on Rover.
Instructions
Update an existing pet's profile details such as size, temperament, and special needs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| petId | Yes | The pet's ID on Rover | |
| name | No | Updated pet name | |
| breed | No | Updated breed | |
| age | No | Updated age in years | |
| weight | No | Updated weight in pounds | |
| size | No | Updated size category | |
| temperament | No | Updated temperament description | |
| specialNeeds | No | Updated special needs or care notes | |
| vaccinated | No | Updated vaccination status | |
| spayedNeutered | No | Updated spayed/neutered status |
Implementation Reference
- src/browser.ts:528-557 (handler)The updatePetProfile async method implements the core tool logic using Playwright browser automation. It navigates to the pet edit page, fills in updated name and special needs fields, and submits the form, returning a success boolean.
async updatePetProfile( petId: string, updates: Partial<Pet> ): Promise<{ success: boolean }> { if (!this.session.isLoggedIn) { throw new Error("You must be logged in to update a pet profile."); } const page = this.ensurePage(); await page.goto(`${this.BASE_URL}/account/pets/${petId}/edit/`); await page.waitForLoadState("networkidle"); if (updates.name) { const nameInput = page.locator('input[name="name"]').first(); if (await nameInput.isVisible()) await nameInput.fill(updates.name); } if (updates.specialNeeds) { const needsInput = page.locator('textarea[name*="special"], textarea[name*="needs"]').first(); if (await needsInput.isVisible()) await needsInput.fill(updates.specialNeeds); } const submitBtn = page.locator('button[type="submit"]').first(); if (await submitBtn.isVisible()) { await submitBtn.click(); await page.waitForLoadState("networkidle"); return { success: true }; } return { success: false }; } - src/index.ts:347-358 (schema)UpdatePetSchema defines the Zod validation schema for tool inputs. It validates petId as required string, and optional fields including name, breed, age, weight, size (enum), temperament, specialNeeds, vaccinated, and spayedNeutered.
const UpdatePetSchema = z.object({ petId: z.string().min(1), name: z.string().optional(), breed: z.string().optional(), age: z.number().optional(), weight: z.number().optional(), size: z.enum(["small", "medium", "large", "giant"]).optional(), temperament: z.string().optional(), specialNeeds: z.string().optional(), vaccinated: z.boolean().optional(), spayedNeutered: z.boolean().optional(), }); - src/index.ts:222-246 (registration)Tool registration defines 'update_pet_profile' with description and JSON Schema inputSchema. Specifies petId as required, and all other pet properties as optional with type definitions and descriptions.
{ name: "update_pet_profile", description: "Update an existing pet's profile details such as size, temperament, and special needs.", inputSchema: { type: "object", properties: { petId: { type: "string", description: "The pet's ID on Rover" }, name: { type: "string", description: "Updated pet name" }, breed: { type: "string", description: "Updated breed" }, age: { type: "number", description: "Updated age in years" }, weight: { type: "number", description: "Updated weight in pounds" }, size: { type: "string", enum: ["small", "medium", "large", "giant"], description: "Updated size category", }, temperament: { type: "string", description: "Updated temperament description" }, specialNeeds: { type: "string", description: "Updated special needs or care notes" }, vaccinated: { type: "boolean", description: "Updated vaccination status" }, spayedNeutered: { type: "boolean", description: "Updated spayed/neutered status" }, }, required: ["petId"], }, }, - src/index.ts:552-565 (handler)The switch case handler for 'update_pet_profile' tool calls. Parses input arguments with UpdatePetSchema, extracts petId and updates, invokes browser.updatePetProfile(), and returns formatted success/failure response.
case "update_pet_profile": { const { petId, ...updates } = UpdatePetSchema.parse(args); const result = await browser.updatePetProfile(petId, updates); return { content: [ { type: "text", text: result.success ? `Pet profile ${petId} updated successfully!` : "Failed to update pet profile. Please try again.", }, ], }; } - src/browser.ts:84-97 (schema)The Pet TypeScript interface defines the data structure for pet objects with properties: id, name, species, and optional breed, age, weight, size, temperament, specialNeeds, vaccinated, spayedNeutered, and profilePhotoUrl.
export interface Pet { id: string; name: string; species: "dog" | "cat" | "other"; breed?: string; age?: number; weight?: number; size?: "small" | "medium" | "large" | "giant"; temperament?: string; specialNeeds?: string; vaccinated?: boolean; spayedNeutered?: boolean; profilePhotoUrl?: string; }