sentry_finish_transaction
Finalizes a transaction in MCP Sentry para Cursor, allowing users to set its status such as 'ok', 'cancelled', or 'internal_error', ensuring accurate error and performance monitoring.
Instructions
Finish the current transaction
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Transaction status | ok |
Implementation Reference
- src/index.ts:879-897 (handler)Handler for 'sentry_finish_transaction' tool. Extracts status from arguments, checks for active transaction, ends it using currentTransaction.end(), resets currentTransaction to null, and returns a text response confirming the finish with the status.case "sentry_finish_transaction": { const { status = "ok" } = args as any; if (!currentTransaction) { throw new Error("No active transaction to finish"); } currentTransaction.end(); currentTransaction = null; return { content: [ { type: "text", text: `Transaction finished with status: ${status}`, }, ], }; }
- src/index.ts:285-295 (schema)Input schema definition for the 'sentry_finish_transaction' tool, specifying an optional 'status' string parameter with a default of 'ok' and a list of allowed status values.inputSchema: { type: "object", properties: { status: { type: "string", description: "Transaction status", enum: ["ok", "cancelled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal_error", "unavailable", "data_loss", "unauthenticated"], default: "ok", }, }, },
- src/index.ts:282-296 (registration)Tool registration in the ListToolsRequestSchema handler's tools array, defining the name, description, and input schema for 'sentry_finish_transaction'.{ name: "sentry_finish_transaction", description: "Finish the current transaction", inputSchema: { type: "object", properties: { status: { type: "string", description: "Transaction status", enum: ["ok", "cancelled", "unknown", "invalid_argument", "deadline_exceeded", "not_found", "already_exists", "permission_denied", "resource_exhausted", "failed_precondition", "aborted", "out_of_range", "unimplemented", "internal_error", "unavailable", "data_loss", "unauthenticated"], default: "ok", }, }, }, },
- src/index.ts:706-706 (helper)Global variable used to store the current Sentry transaction span, shared between 'sentry_start_transaction' and 'sentry_finish_transaction' tools.let currentTransaction: any | null = null;