get_user_websites
Retrieve websites accessible to a specific user for administrative oversight and permission management.
Instructions
Get the list of websites a user has access to (admin only)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | User UUID | |
| page | No | Page number (1-based) | |
| pageSize | No | Results per page | |
| query | No | Search query to filter websites |
Implementation Reference
- src/tools/users.ts:85-102 (handler)The 'get_user_websites' tool is registered and implemented within the 'registerUserTools' function in src/tools/users.ts. It takes 'userId' and optional pagination/filtering parameters as input and uses the UmamiClient to make a GET request to '/api/users/${userId}/websites'.
server.tool( "get_user_websites", "Get the list of websites a user has access to (admin only)", { userId: z.string().describe("User UUID"), page: z.number().optional().describe("Page number (1-based)"), pageSize: z.number().optional().describe("Results per page"), query: z.string().optional().describe("Search query to filter websites"), }, async ({ userId, page, pageSize, query }) => { const data = await client.call("GET", `/api/users/${userId}/websites`, undefined, { page, pageSize, query, }); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );