sentry_set_user
Set user context in Sentry to track errors and performance by user ID, email, IP address, and segment for better debugging and monitoring.
Instructions
Set user context for Sentry
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | User ID | |
| No | User email | ||
| username | No | Username | |
| ip_address | No | User IP address | |
| segment | No | User segment |
Implementation Reference
- src/index.ts:812-824 (handler)Handler for the 'sentry_set_user' tool. Extracts user information from arguments and sets it as the current user context in Sentry using Sentry.setUser(). Returns a confirmation message.case "sentry_set_user": { const userInfo = args as any; Sentry.setUser(userInfo); return { content: [ { type: "text", text: `User context set: ${JSON.stringify(userInfo)}`, }, ], }; }
- src/index.ts:194-222 (registration)Tool registration in the ListTools response, defining the name, description, and input schema for 'sentry_set_user'.{ name: "sentry_set_user", description: "Set user context for Sentry", inputSchema: { type: "object", properties: { id: { type: "string", description: "User ID", }, email: { type: "string", description: "User email", }, username: { type: "string", description: "Username", }, ip_address: { type: "string", description: "User IP address", }, segment: { type: "string", description: "User segment", }, }, }, },
- src/index.ts:197-222 (schema)Input schema definition for the 'sentry_set_user' tool, specifying optional properties for user context.inputSchema: { type: "object", properties: { id: { type: "string", description: "User ID", }, email: { type: "string", description: "User email", }, username: { type: "string", description: "Username", }, ip_address: { type: "string", description: "User IP address", }, segment: { type: "string", description: "User segment", }, }, }, },