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[];
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that '資訊過多可能導致程式異常' (too much information may cause program exceptions), which hints at a performance or stability limitation. However, it lacks details on pagination behavior (implied by page/pageSize parameters but not explained), rate limits, authentication needs, or what happens with invalid inputs. For a tool with 8 parameters and no annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core purpose first ('獲取 Mantis 問題列表') followed by additional context. It consists of two sentences that each serve a purpose: defining the tool and providing a usage tip. There's no wasted text, though it could be slightly more structured for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, no output schema, no annotations), the description is incomplete. It lacks information on return values, error handling, pagination behavior, and how filtering conditions interact. The warning about too much information causing exceptions is helpful but doesn't compensate for the broader gaps. For a list-retrieval tool with multiple filters, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all 8 parameters thoroughly. The description adds minimal value beyond the schema: it suggests limiting the 'select' field to id, summary, and description to avoid issues. This provides some practical advice but doesn't significantly enhance understanding of parameter meanings or interactions. The baseline score of 3 is appropriate given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '獲取 Mantis 問題列表' (get Mantis issue list). It specifies the verb ('獲取' - get) and resource ('Mantis 問題列表' - Mantis issue list), making the basic function unambiguous. However, it doesn't explicitly differentiate from sibling tools like get_issue_by_id or get_issue_statistics, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage guidance: '建議查詢時select選擇id,summary,description就好,資訊過多可能導致程式異常' (suggests selecting only id, summary, description during queries, as too much information may cause program exceptions). This implies a constraint on usage but doesn't explicitly state when to use this tool versus alternatives like get_issue_by_id or get_issue_statistics, nor does it provide broader context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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