Skip to main content
Glama

getMyBugs

Retrieve bugs assigned to you in a ZenTao product. Filter by status or keyword to manage bug tracking and resolution.

Instructions

List bugs assigned to me under a product. Defaults to active bugs only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
productIdYesProduct ID (required)
keywordNoKeyword filter on bug title
statusNoStatus filter (e.g., active)
allStatusesNoInclude non-active bugs
limitNoMax items

Implementation Reference

  • Handler implementation for the 'getMyBugs' tool within the CallToolRequestSchema handler. Extracts arguments, invokes fetchBugsByProduct helper, and formats the response as JSON.
    if (name === "getMyBugs") {
      const { productId, keyword, status, allStatuses = false, limit = 20 } = args;
      const { bugs, raw } = await fetchBugsByProduct({
        productId,
        keyword,
        allStatuses,
        status,
        limit,
      });
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({ bugs, raw }, null, 2),
          },
        ],
      };
    }
  • Registration of the 'getMyBugs' tool in the ListToolsRequestSchema response, including name, description, and input schema.
    {
      name: "getMyBugs",
      description:
        "List bugs assigned to me under a product. Defaults to active bugs only.",
      inputSchema: {
        type: "object",
        properties: {
          productId: { type: "number", description: "Product ID (required)" },
          keyword: { type: "string", description: "Keyword filter on bug title" },
          status: { type: "string", description: "Status filter (e.g., active)" },
          allStatuses: {
            type: "boolean",
            description: "Include non-active bugs",
            default: false,
          },
          limit: { type: "number", description: "Max items", default: 20 },
        },
        required: ["productId"],
        additionalProperties: false,
      },
    },
  • Core helper function fetchBugsByProduct that queries ZenTao API for bugs in a product, filters by assignee matching current account, keyword, and status.
    async function fetchBugsByProduct({
      productId,
      keyword,
      allStatuses = false,
      status,
      limit = 20,
      page = 1,
    }) {
      const res = await callZenTao({
        // Use /bugs with product filter; works better for assignedTo filtering.
        path: "bugs",
        query: {
          page,
          limit,
          product: productId,
          keywords: keyword,
        },
      });
      const bugs = extractArray(res.data, ["bugs"]);
      const accountLower = (account || "").trim().toLowerCase();
      const statusLower = status ? String(status).trim().toLowerCase() : null;
      const filtered = bugs.filter((bug) => {
        const assignedCandidates = [
          ...normalizeAccount(bug.assignedTo),
          ...normalizeAccount(bug.assignedToName),
          ...normalizeAccount(bug.assignedToRealname),
        ];
        const matchAssignee = accountLower
          ? assignedCandidates.includes(accountLower)
          : true;
        const matchKeyword = keyword
          ? `${bug.title || bug.name || ""}`
          .toLowerCase()
          .includes(keyword.toLowerCase())
          : true;
        const matchStatus = allStatuses
          ? true
          : statusLower
          ? String(bug.status || bug.state || "")
              .trim()
              .toLowerCase() === statusLower
          : true;
        return matchAssignee && matchKeyword && matchStatus;
      });
      return { bugs: filtered, raw: res.data };
    }

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/Valiant-Cat/zentao-mcp-server'

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