Skip to main content
Glama
nulab

Backlog MCP Server

count_issues

Count issues in Backlog projects using filters like project, status, priority, assignee, dates, and custom fields to track work items.

Instructions

Returns count of issues

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdNoProject IDs
issueTypeIdNoIssue type IDs
categoryIdNoCategory IDs
versionIdNoVersion IDs
milestoneIdNoMilestone IDs
statusIdNoStatus IDs
priorityIdNoPriority IDs
assigneeIdNoAssignee user IDs
createdUserIdNoCreated user IDs
resolutionIdNoResolution IDs
parentIssueIdNoParent issue IDs
keywordNoKeyword to search for in issues
startDateSinceNoStart date since (yyyy-MM-dd)
startDateUntilNoStart date until (yyyy-MM-dd)
dueDateSinceNoDue date since (yyyy-MM-dd)
dueDateUntilNoDue date until (yyyy-MM-dd)
createdSinceNoCreated since (yyyy-MM-dd)
createdUntilNoCreated until (yyyy-MM-dd)
updatedSinceNoUpdated since (yyyy-MM-dd)
updatedUntilNoUpdated until (yyyy-MM-dd)
customFieldsNoCustom field filters (text, numeric, date, or list)

Implementation Reference

  • The handler function for the 'count_issues' tool. It spreads the input parameters (rest) and adds custom field filters, then calls the Backlog API's getIssuesCount method to return the count of matching issues.
    handler: async ({ customFields, ...rest }) => {
      return backlog.getIssuesCount({
        ...rest,
        ...customFieldFiltersToPayload(customFields),
      });
    },
  • Zod input schema definition for the 'count_issues' tool, including optional arrays for IDs (project, type, etc.), strings for keywords and dates, and custom fields filters.
    const countIssuesSchema = buildToolSchema((t) => ({
      projectId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_PROJECT_ID', 'Project IDs')),
      issueTypeId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_ISSUE_TYPE_ID', 'Issue type IDs')),
      categoryId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_CATEGORY_ID', 'Category IDs')),
      versionId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_VERSION_ID', 'Version IDs')),
      milestoneId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_MILESTONE_ID', 'Milestone IDs')),
      statusId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_STATUS_ID', 'Status IDs')),
      priorityId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_PRIORITY_ID', 'Priority IDs')),
      assigneeId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_ASSIGNEE_ID', 'Assignee user IDs')),
      createdUserId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_CREATED_USER_ID', 'Created user IDs')),
      resolutionId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_RESOLUTION_ID', 'Resolution IDs')),
      parentIssueId: z
        .array(z.number())
        .optional()
        .describe(t('TOOL_COUNT_ISSUES_PARENT_ISSUE_ID', 'Parent issue IDs')),
      keyword: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_KEYWORD', 'Keyword to search for in issues')
        ),
      startDateSince: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_START_DATE_SINCE', 'Start date since (yyyy-MM-dd)')
        ),
      startDateUntil: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_START_DATE_UNTIL', 'Start date until (yyyy-MM-dd)')
        ),
      dueDateSince: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_DUE_DATE_SINCE', 'Due date since (yyyy-MM-dd)')
        ),
      dueDateUntil: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_DUE_DATE_UNTIL', 'Due date until (yyyy-MM-dd)')
        ),
      createdSince: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_CREATED_SINCE', 'Created since (yyyy-MM-dd)')
        ),
      createdUntil: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_CREATED_UNTIL', 'Created until (yyyy-MM-dd)')
        ),
      updatedSince: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_UPDATED_SINCE', 'Updated since (yyyy-MM-dd)')
        ),
      updatedUntil: z
        .string()
        .optional()
        .describe(
          t('TOOL_COUNT_ISSUES_UPDATED_UNTIL', 'Updated until (yyyy-MM-dd)')
        ),
      customFields: z
        .array(buildCustomFieldFilterSchema(t))
        .optional()
        .describe(
          t(
            'TOOL_COUNT_ISSUES_CUSTOM_FIELDS',
            'Custom field filters (text, numeric, date, or list)'
          )
        ),
    }));
  • The 'countIssuesTool' factory is called with backlog client and translation helper to instantiate the ToolDefinition, which is added to the 'issue' toolset in the allTools export.
    countIssuesTool(backlog, helper),
  • Import of the countIssuesTool factory function from its module.
    import { countIssuesTool } from './countIssues.js';
  • The input schema is constructed by wrapping countIssuesSchema with z.object and passing the translation helper.
    schema: z.object(countIssuesSchema(t)),
    outputSchema: IssueCountSchema,
Behavior1/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 but offers nothing beyond the basic purpose. It doesn't indicate whether this is a read-only operation, whether it requires authentication, what the performance characteristics might be, whether results are cached, or what format the count is returned in. For a tool with 21 parameters and complex filtering capabilities, this is a critical gap.

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

Conciseness2/5

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

While the description is technically concise with just three words, it's under-specified rather than appropriately concise. For a tool with 21 complex filtering parameters, a three-word description fails to provide necessary context. The description doesn't earn its place by adding value beyond what's obvious from the tool name.

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

Completeness1/5

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

Given the tool's complexity (21 parameters, no output schema, no annotations), the description is completely inadequate. It doesn't explain what 'count' means in this context, how filtering works with multiple parameters, whether parameters are AND/OR combined, what happens when no parameters are provided, or what the return value looks like. The description fails to compensate for the lack of output schema and annotations.

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%, meaning all parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond what's already in the schema. According to the scoring guidelines, when schema coverage is high (>80%), the baseline is 3 even with no parameter information in the description.

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

Purpose2/5

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

The description 'Returns count of issues' is a tautology that essentially restates the tool name 'count_issues' without adding meaningful specificity. It doesn't clarify what type of counting operation this is (e.g., filtered count, total count, aggregated count) or distinguish it from sibling tools like 'get_issues' or 'get_pull_requests_count' that might also provide counting functionality.

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

Usage Guidelines1/5

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

The description provides absolutely no guidance on when to use this tool versus alternatives. With sibling tools like 'get_issues' (which likely returns issue details) and 'get_pull_requests_count' (which counts pull requests), there's no indication of when this specific counting tool is appropriate versus other counting or listing tools in the system.

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

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/nulab/backlog-mcp-server'

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