Skip to main content
Glama

sentry_start_transaction

Start performance monitoring transactions to track application operations like HTTP requests and database queries for error detection and optimization.

Instructions

Start a performance monitoring transaction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesTransaction name
opYesOperation type (e.g., 'http.request', 'db.query')
descriptionNoTransaction description

Implementation Reference

  • Handler for the 'sentry_start_transaction' tool. Extracts parameters, ends any existing transaction, starts a new Sentry span (transaction) using Sentry.startSpan, stores it in currentTransaction, and returns a confirmation message.
    case "sentry_start_transaction": { const { name: transactionName, op, description } = args as any; if (currentTransaction) { currentTransaction.end(); } currentTransaction = Sentry.startSpan( { name: transactionName, op }, () => { // Transaction is active here return null; } ); return { content: [ { type: "text", text: `Transaction started: ${transactionName} (${op})`, }, ], }; }
  • src/index.ts:260-281 (registration)
    Registration of the 'sentry_start_transaction' tool in the ListTools response, including name, description, and input schema definition.
    { name: "sentry_start_transaction", description: "Start a performance monitoring transaction", inputSchema: { type: "object", properties: { name: { type: "string", description: "Transaction name", }, op: { type: "string", description: "Operation type (e.g., 'http.request', 'db.query')", }, description: { type: "string", description: "Transaction description", }, }, required: ["name", "op"], }, },
  • Input schema definition for the 'sentry_start_transaction' tool, specifying required 'name' and 'op' parameters with optional 'description'.
    inputSchema: { type: "object", properties: { name: { type: "string", description: "Transaction name", }, op: { type: "string", description: "Operation type (e.g., 'http.request', 'db.query')", }, description: { type: "string", description: "Transaction description", }, }, required: ["name", "op"], },
  • Global variable used to track the current active transaction/span for coordination between start and finish transactions.
    let currentTransaction: any | null = null;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/diegofornalha/sentry-mcp-cursor'

If you have feedback or need assistance with the MCP directory API, please join our Discord server