sentry_add_breadcrumb
Add detailed debugging context to logs by creating breadcrumbs with custom messages, categories, severity levels, and additional data for error tracking.
Instructions
Add a breadcrumb for debugging context
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Category of the breadcrumb | |
| data | No | Additional data for the breadcrumb | |
| level | No | Severity level | info |
| message | Yes | Breadcrumb message |
Implementation Reference
- src/index.ts:791-810 (handler)Handler for the sentry_add_breadcrumb tool. Destructures input arguments and calls Sentry.addBreadcrumb with mapped severity level, returning confirmation message.case "sentry_add_breadcrumb": { const { message, category, level = "info", data } = args as any; Sentry.addBreadcrumb({ message, category, level: mapSeverityLevel(level), data, timestamp: Date.now() / 1000, }); return { content: [ { type: "text", text: `Breadcrumb added: ${message}`, }, ], }; }
- src/index.ts:168-192 (schema)Input schema definition for sentry_add_breadcrumb tool, specifying required 'message' and optional category, level, data.inputSchema: { type: "object", properties: { message: { type: "string", description: "Breadcrumb message", }, category: { type: "string", description: "Category of the breadcrumb", }, level: { type: "string", enum: ["fatal", "error", "warning", "info", "debug"], description: "Severity level", default: "info", }, data: { type: "object", description: "Additional data for the breadcrumb", additionalProperties: true, }, }, required: ["message"], },
- src/index.ts:166-193 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and inputSchema for sentry_add_breadcrumb.name: "sentry_add_breadcrumb", description: "Add a breadcrumb for debugging context", inputSchema: { type: "object", properties: { message: { type: "string", description: "Breadcrumb message", }, category: { type: "string", description: "Category of the breadcrumb", }, level: { type: "string", enum: ["fatal", "error", "warning", "info", "debug"], description: "Severity level", default: "info", }, data: { type: "object", description: "Additional data for the breadcrumb", additionalProperties: true, }, }, required: ["message"], }, },
- src/index.ts:694-703 (helper)Helper function mapSeverityLevel used in sentry_add_breadcrumb handler to convert input level string to Sentry SeverityLevel.function mapSeverityLevel(level: string): Sentry.SeverityLevel { const severityMap: Record<string, Sentry.SeverityLevel> = { fatal: "fatal", error: "error", warning: "warning", info: "info", debug: "debug", }; return severityMap[level] || "error"; }