List Issue File Attachments
list_issue_filesRetrieve file attachments for a MantisBT issue to access documentation, screenshots, or logs associated with bug reports.
Instructions
List all file attachments of a MantisBT issue.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | Numeric issue ID |
Implementation Reference
- src/tools/files.ts:23-49 (registration)The tool 'list_issue_files' is registered and implemented in src/tools/files.ts using `server.registerTool`. The handler function processes the `issue_id`, fetches the issue data from the `MantisClient`, and returns the attached files.
server.registerTool( 'list_issue_files', { title: 'List Issue File Attachments', description: 'List all file attachments of a MantisBT issue.', inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID'), }), annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, }, }, async ({ issue_id }) => { try { const result = await client.get<{ issues: Array<{ attachments?: MantisFile[] }> }>(`issues/${issue_id}`); const attachments = result.issues?.[0]?.attachments ?? []; return { content: [{ type: 'text', text: JSON.stringify(attachments, null, 2) }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } );