Skip to main content
Glama

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,

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