sentry_start_session
Start a new session to monitor release health by tracking user activity with unique identifiers, session IDs, release versions, and environment data.
Instructions
Start a new session for release health monitoring
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| distinctId | No | Unique user identifier (ID, email, or username) | |
| sessionId | No | Optional custom session ID | |
| release | No | Release version | |
| environment | No | Environment name (production, staging, etc) |
Implementation Reference
- src/index.ts:899-922 (handler)The switch case handler that executes the sentry_start_session tool. It destructures the arguments, prepares session data, optionally sets the user, calls Sentry.startSession, and returns a confirmation message.case "sentry_start_session": { const { distinctId, sessionId, release, environment } = args as any; // Start a new session const sessionData: any = { release, environment, }; if (distinctId) { Sentry.setUser({ id: distinctId }); } Sentry.startSession(sessionData); return { content: [ { type: "text", text: `Session started${sessionId ? ` with ID: ${sessionId}` : ''}`, }, ], }; }
- src/index.ts:297-321 (registration)Tool registration in the ListToolsRequestSchema handler, including the tool name, description, and input schema definition.{ name: "sentry_start_session", description: "Start a new session for release health monitoring", inputSchema: { type: "object", properties: { distinctId: { type: "string", description: "Unique user identifier (ID, email, or username)", }, sessionId: { type: "string", description: "Optional custom session ID", }, release: { type: "string", description: "Release version", }, environment: { type: "string", description: "Environment name (production, staging, etc)", }, }, }, },
- src/index.ts:297-321 (schema)Input schema definition for the sentry_start_session tool, specifying properties for distinctId, sessionId, release, and environment.{ name: "sentry_start_session", description: "Start a new session for release health monitoring", inputSchema: { type: "object", properties: { distinctId: { type: "string", description: "Unique user identifier (ID, email, or username)", }, sessionId: { type: "string", description: "Optional custom session ID", }, release: { type: "string", description: "Release version", }, environment: { type: "string", description: "Environment name (production, staging, etc)", }, }, }, },