list_instruments
Display all active debug instruments to monitor and manage code instrumentation during debugging sessions.
Instructions
List all active debug instruments.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:252-273 (handler)The switch case handler for the 'list_instruments' tool. It fetches all active instruments using sessionManager.getInstruments() and formats them into a text list, returning it via the MCP response format or a 'No active instruments' message if empty.case 'list_instruments': { const instruments = sessionManager.getInstruments(); if (instruments.length === 0) { return { content: [{ type: 'text', text: 'No active instruments.' }], }; } const list = instruments .map((i) => `- ${i.id}: ${i.file}:${i.line} [${i.capture.join(', ') || 'no capture'}]`) .join('\n'); return { content: [ { type: 'text', text: `Active instruments (${instruments.length}):\n\n${list}`, }, ], }; }
- src/index.ts:93-100 (registration)Tool registration entry for 'list_instruments' in the ListToolsRequestHandler response, defining name, description, and empty input schema.{ name: 'list_instruments', description: 'List all active debug instruments.', inputSchema: { type: 'object', properties: {}, }, },
- src/session.ts:85-90 (helper)SessionManager helper method that returns the array of all active Instrument objects stored in the session Map.getInstruments(): Instrument[] { if (!this.session) { return []; } return Array.from(this.session.instruments.values()); }