Skip to main content
Glama

get_issues

Retrieve and filter issues from Mantis Bug Tracker by project, status, handler, reporter, or keywords. Specify fields like id, summary, and description to optimize query results and avoid errors.

Instructions

獲取 Mantis 問題列表,可根據多個條件進行過濾,建議查詢時select選擇id,summary,description就好,資訊過多可能導致程式異常

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
handlerIdNo處理人 ID
pageNo分頁起始位置,從1開始
pageSizeNo頁數大小
projectIdNo專案 ID
reporterIdNo報告者 ID
searchNo搜尋關鍵字
selectNo選擇要返回的欄位,例如:['id', 'summary', 'description']
statusIdNo狀態 ID

Implementation Reference

  • The handler function for the MCP 'get_issues' tool. It checks if Mantis is configured, calls mantisApi.getIssues with the provided params, stringifies the issues, and applies gzip compression if the JSON exceeds 100KB threshold, returning compressed base64 data.
    async (params) => { return withMantisConfigured("get_issues", async () => { const issues = await mantisApi.getIssues(params); const jsonString = JSON.stringify(issues); if (jsonString.length < COMPRESSION_THRESHOLD) { return jsonString; } const compressed = await gzipAsync(Buffer.from(jsonString)); const base64Data = compressed.toString('base64'); return JSON.stringify({ compressed: true, data: base64Data, originalSize: jsonString.length, compressedSize: base64Data.length }); }); }
  • Zod input schema validation for the 'get_issues' tool parameters including projectId, statusId, handlerId, reporterId, search, pagination, and select fields.
    { projectId: z.number().optional().describe("專案 ID"), statusId: z.number().optional().describe("狀態 ID"), handlerId: z.number().optional().describe("處理人 ID"), reporterId: z.number().optional().describe("報告者 ID"), search: z.string().optional().describe("搜尋關鍵字"), pageSize: z.number().optional().default(20).describe("頁數大小"), page: z.number().optional().default(0).describe("分頁起始位置,從1開始"), select: z.array(z.string()).optional().describe("選擇要返回的欄位,例如:['id', 'summary', 'description']"), },
  • src/server.ts:121-154 (registration)
    Registration of the 'get_issues' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool( "get_issues", "獲取 Mantis 問題列表,可根據多個條件進行過濾,建議查詢時select選擇id,summary,description就好,資訊過多可能導致程式異常", { projectId: z.number().optional().describe("專案 ID"), statusId: z.number().optional().describe("狀態 ID"), handlerId: z.number().optional().describe("處理人 ID"), reporterId: z.number().optional().describe("報告者 ID"), search: z.string().optional().describe("搜尋關鍵字"), pageSize: z.number().optional().default(20).describe("頁數大小"), page: z.number().optional().default(0).describe("分頁起始位置,從1開始"), select: z.array(z.string()).optional().describe("選擇要返回的欄位,例如:['id', 'summary', 'description']"), }, async (params) => { return withMantisConfigured("get_issues", async () => { const issues = await mantisApi.getIssues(params); const jsonString = JSON.stringify(issues); if (jsonString.length < COMPRESSION_THRESHOLD) { return jsonString; } const compressed = await gzipAsync(Buffer.from(jsonString)); const base64Data = compressed.toString('base64'); return JSON.stringify({ compressed: true, data: base64Data, originalSize: jsonString.length, compressedSize: base64Data.length }); }); } );
  • Helper function mantisApi.getIssues that constructs query parameters, applies caching, and makes HTTP GET request to Mantis API /issues endpoint to retrieve filtered and paginated issues.
    async getIssues(params: IssueSearchParams = {}): Promise<Issue[]> { log.info('獲取問題列表', { params }); // 構建過濾 URL let filter = ''; if (params.projectId) filter += `&project_id=${params.projectId}`; if (params.statusId) filter += `&status_id=${params.statusId}`; if (params.handlerId) filter += `&handler_id=${params.handlerId}`; if (params.reporterId) filter += `&reporter_id=${params.reporterId}`; if (params.priority) filter += `&priority=${params.priority}`; if (params.severity) filter += `&severity=${params.severity}`; if (params.search) filter += `&search=${encodeURIComponent(params.search)}`; if (params.select?.length) filter += `&select=${params.select.join(',')}`; const pageSize = params.pageSize || 50; const page = params.page ||1; const cacheKey = `issues-${filter}-${page}-${pageSize}`; const response = await this.cachedRequest<{issues: Issue[]}>(cacheKey, () => { return this.api.get(`/issues?page=${page}&page_size=${pageSize}${filter}`); }); return response.issues; }
  • TypeScript interface defining the shape of IssueSearchParams used in mantisApi.getIssues function.
    export interface IssueSearchParams { projectId?: number; statusId?: number; handlerId?: number; reporterId?: number; priority?: number; severity?: number; pageSize?: number; page?: number; search?: string; select?: string[]; }

Other Tools

Related Tools

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/kfnzero/mantis-mcp-server'

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