import { z } from 'zod';
/**
* Schema for listing issues with filters
*/
export const ListIssuesSchema = z.object({
teamId: z.string().optional().describe('Filter by team ID'),
projectId: z.string().optional().describe('Filter by project ID'),
assigneeId: z.string().optional().describe('Filter by assignee user ID'),
status: z
.enum([
'backlog',
'unstarted',
'started',
'completed',
'canceled',
'triage',
'in_progress',
'done',
])
.optional()
.describe('Filter by status'),
priority: z
.number()
.min(0)
.max(4)
.optional()
.describe('Filter by priority (0=None, 1=Urgent, 2=High, 3=Medium, 4=Low)'),
label: z.string().optional().describe('Filter by label name'),
limit: z.number().min(1).max(100).default(25).describe('Maximum number of issues to return'),
includeArchived: z.boolean().default(false).describe('Include archived issues'),
});
export type ListIssuesInput = z.infer<typeof ListIssuesSchema>;
/**
* Schema for creating a new issue
*/
export const CreateIssueSchema = z.object({
title: z.string().min(1).describe('Issue title (required)'),
description: z.string().optional().describe('Issue description in markdown format'),
teamId: z.string().describe('Team ID where the issue will be created (required)'),
projectId: z.string().optional().describe('Project ID to assign the issue to'),
assigneeId: z.string().optional().describe('User ID to assign the issue to'),
priority: z
.number()
.min(0)
.max(4)
.optional()
.describe('Priority (0=None, 1=Urgent, 2=High, 3=Medium, 4=Low)'),
labelIds: z.array(z.string()).optional().describe('Array of label IDs to add to the issue'),
stateId: z.string().optional().describe('Workflow state ID'),
estimate: z.number().optional().describe('Estimate in points'),
dueDate: z.string().optional().describe('Due date in ISO 8601 format (YYYY-MM-DD)'),
parentId: z.string().optional().describe('Parent issue ID for sub-issues'),
cycleId: z.string().optional().describe('Cycle ID to assign the issue to'),
});
export type CreateIssueInput = z.infer<typeof CreateIssueSchema>;
/**
* Schema for updating an existing issue
*/
export const UpdateIssueSchema = z.object({
issueId: z.string().describe('Issue ID or identifier (e.g., "TEAM-123")'),
title: z.string().optional().describe('New issue title'),
description: z.string().optional().describe('New issue description in markdown'),
assigneeId: z.string().optional().describe('New assignee user ID (use null to unassign)'),
priority: z.number().min(0).max(4).optional().describe('New priority'),
stateId: z.string().optional().describe('New workflow state ID'),
labelIds: z.array(z.string()).optional().describe('New array of label IDs (replaces existing)'),
estimate: z.number().optional().describe('New estimate in points'),
dueDate: z.string().optional().describe('New due date in ISO 8601 format'),
projectId: z.string().optional().describe('New project ID'),
cycleId: z.string().optional().describe('New cycle ID (use null to remove from cycle)'),
});
export type UpdateIssueInput = z.infer<typeof UpdateIssueSchema>;
/**
* Schema for getting issue details
*/
export const GetIssueSchema = z.object({
issueId: z.string().describe('Issue ID or identifier (e.g., "TEAM-123")'),
});
export type GetIssueInput = z.infer<typeof GetIssueSchema>;
/**
* Schema for searching issues
*/
export const SearchIssuesSchema = z.object({
query: z.string().min(1).describe('Search query text'),
teamId: z.string().optional().describe('Limit search to specific team'),
limit: z.number().min(1).max(100).default(25).describe('Maximum number of results'),
includeArchived: z.boolean().default(false).describe('Include archived issues'),
});
export type SearchIssuesInput = z.infer<typeof SearchIssuesSchema>;
/**
* Schema for listing teams
*/
export const ListTeamsSchema = z.object({
includeArchived: z.boolean().default(false).describe('Include archived teams'),
});
export type ListTeamsInput = z.infer<typeof ListTeamsSchema>;
/**
* Schema for getting team details
*/
export const GetTeamSchema = z.object({
teamId: z.string().describe('Team ID (required)'),
});
export type GetTeamInput = z.infer<typeof GetTeamSchema>;
/**
* Schema for creating a team
*/
export const CreateTeamSchema = z.object({
name: z.string().min(1).describe('Team name (required)'),
key: z.string().min(1).max(5).describe('Team key (1-5 uppercase letters, e.g., "ENG")'),
description: z.string().optional().describe('Team description'),
icon: z.string().optional().describe('Team icon (emoji)'),
color: z.string().optional().describe('Team color in hex format (e.g., "#FF0000")'),
timezone: z.string().optional().describe('Team timezone (e.g., "America/Los_Angeles")'),
private: z.boolean().optional().describe('Whether the team is private'),
});
export type CreateTeamInput = z.infer<typeof CreateTeamSchema>;
/**
* Schema for updating a team
*/
export const UpdateTeamSchema = z.object({
teamId: z.string().describe('Team ID (required)'),
name: z.string().optional().describe('New team name'),
key: z.string().min(1).max(5).optional().describe('New team key'),
description: z.string().optional().describe('New team description'),
icon: z.string().optional().describe('New team icon'),
color: z.string().optional().describe('New team color'),
timezone: z.string().optional().describe('New team timezone'),
private: z.boolean().optional().describe('Whether the team is private'),
});
export type UpdateTeamInput = z.infer<typeof UpdateTeamSchema>;
/**
* Schema for archiving a team
*/
export const ArchiveTeamSchema = z.object({
teamId: z.string().describe('Team ID to archive (required)'),
});
export type ArchiveTeamInput = z.infer<typeof ArchiveTeamSchema>;
/**
* Schema for unarchiving a team
*/
export const UnarchiveTeamSchema = z.object({
teamId: z.string().describe('Team ID to unarchive (required)'),
});
export type UnarchiveTeamInput = z.infer<typeof UnarchiveTeamSchema>;
/**
* Schema for listing projects
*/
export const ListProjectsSchema = z.object({
teamId: z.string().optional().describe('Filter by team ID'),
includeArchived: z.boolean().default(false).describe('Include archived projects'),
});
export type ListProjectsInput = z.infer<typeof ListProjectsSchema>;
/**
* Schema for creating a cycle (sprint)
*/
export const CreateCycleSchema = z.object({
teamId: z.string().describe('Team ID where the cycle will be created'),
name: z.string().min(1).describe('Cycle name'),
description: z.string().optional().describe('Cycle description'),
startsAt: z.string().describe('Start date in ISO 8601 format'),
endsAt: z.string().describe('End date in ISO 8601 format'),
});
export type CreateCycleInput = z.infer<typeof CreateCycleSchema>;
/**
* Schema for listing cycles
*/
export const ListCyclesSchema = z.object({
teamId: z.string().describe('Team ID to list cycles for'),
includeArchived: z.boolean().default(false).describe('Include archived cycles'),
});
export type ListCyclesInput = z.infer<typeof ListCyclesSchema>;
/**
* Schema for getting cycle details
*/
export const GetCycleSchema = z.object({
cycleId: z.string().describe('Cycle ID (required)'),
});
export type GetCycleInput = z.infer<typeof GetCycleSchema>;
/**
* Schema for updating a cycle
*/
export const UpdateCycleSchema = z.object({
cycleId: z.string().describe('Cycle ID (required)'),
name: z.string().optional().describe('New cycle name'),
description: z.string().optional().describe('New cycle description'),
startsAt: z.string().optional().describe('New start date in ISO 8601 format'),
endsAt: z.string().optional().describe('New end date in ISO 8601 format'),
});
export type UpdateCycleInput = z.infer<typeof UpdateCycleSchema>;
/**
* Schema for archiving a cycle
*/
export const ArchiveCycleSchema = z.object({
cycleId: z.string().describe('Cycle ID to archive (required)'),
});
export type ArchiveCycleInput = z.infer<typeof ArchiveCycleSchema>;
/**
* Schema for unarchiving a cycle
*/
export const UnarchiveCycleSchema = z.object({
cycleId: z.string().describe('Cycle ID to unarchive (required)'),
});
export type UnarchiveCycleInput = z.infer<typeof UnarchiveCycleSchema>;
/**
* Schema for assigning an issue
*/
export const AssignIssueSchema = z.object({
issueId: z.string().describe('Issue ID or identifier'),
assigneeId: z.string().describe('User ID to assign the issue to'),
});
export type AssignIssueInput = z.infer<typeof AssignIssueSchema>;
/**
* Schema for creating a label
*/
export const CreateLabelSchema = z.object({
name: z.string().min(1).describe('Label name'),
teamId: z.string().describe('Team ID where the label will be created'),
color: z.string().optional().describe('Label color in hex format (e.g., "#FF0000")'),
description: z.string().optional().describe('Label description'),
});
export type CreateLabelInput = z.infer<typeof CreateLabelSchema>;
/**
* Schema for listing labels
*/
export const ListLabelsSchema = z.object({
teamId: z.string().optional().describe('Filter by team ID'),
});
export type ListLabelsInput = z.infer<typeof ListLabelsSchema>;
/**
* Schema for listing users
*/
export const ListUsersSchema = z.object({
includeDisabled: z.boolean().default(false).describe('Include disabled users'),
});
export type ListUsersInput = z.infer<typeof ListUsersSchema>;
/**
* Schema for adding a comment to an issue
*/
export const AddCommentSchema = z.object({
issueId: z.string().describe('Issue ID or identifier'),
body: z.string().min(1).describe('Comment body in markdown format'),
});
export type AddCommentInput = z.infer<typeof AddCommentSchema>;
/**
* Schema for listing workflow states
*/
export const ListWorkflowStatesSchema = z.object({
teamId: z.string().describe('Team ID to list workflow states for'),
});
export type ListWorkflowStatesInput = z.infer<typeof ListWorkflowStatesSchema>;
/**
* Schema for creating a new project
*/
export const CreateProjectSchema = z.object({
name: z.string().min(1).describe('Project name (required)'),
teamIds: z
.array(z.string())
.min(1)
.describe('Team IDs this project is associated with (required)'),
description: z.string().optional().describe('Project description'),
leadId: z.string().optional().describe('User ID of the project lead'),
memberIds: z.array(z.string()).optional().describe('User IDs of project members'),
color: z.string().optional().describe('Project color in hex format (e.g., "#FF0000")'),
icon: z.string().optional().describe('Project icon (emoji or icon name)'),
priority: z
.number()
.min(0)
.max(4)
.optional()
.describe('Priority (0=None, 1=Urgent, 2=High, 3=Normal, 4=Low)'),
startDate: z.string().optional().describe('Planned start date in ISO 8601 format (YYYY-MM-DD)'),
targetDate: z
.string()
.optional()
.describe('Planned target/completion date in ISO 8601 format (YYYY-MM-DD)'),
statusId: z.string().optional().describe('Project status ID'),
content: z.string().optional().describe('Project content in markdown format'),
});
export type CreateProjectInput = z.infer<typeof CreateProjectSchema>;
/**
* Schema for updating an existing project
*/
export const UpdateProjectSchema = z.object({
projectId: z.string().describe('Project ID (required)'),
name: z.string().optional().describe('New project name'),
description: z.string().optional().describe('New project description'),
leadId: z.string().optional().describe('New project lead user ID'),
memberIds: z
.array(z.string())
.optional()
.describe('New project member user IDs (replaces existing)'),
color: z.string().optional().describe('New project color'),
icon: z.string().optional().describe('New project icon'),
priority: z.number().min(0).max(4).optional().describe('New priority'),
startDate: z.string().optional().describe('New start date in ISO 8601 format'),
targetDate: z.string().optional().describe('New target date in ISO 8601 format'),
statusId: z.string().optional().describe('New project status ID'),
content: z.string().optional().describe('New project content in markdown'),
teamIds: z.array(z.string()).optional().describe('New team IDs (replaces existing)'),
state: z
.enum(['planned', 'started', 'paused', 'completed', 'canceled'])
.optional()
.describe('Project state'),
});
export type UpdateProjectInput = z.infer<typeof UpdateProjectSchema>;
/**
* Schema for getting project details
*/
export const GetProjectSchema = z.object({
projectId: z.string().describe('Project ID (required)'),
});
export type GetProjectInput = z.infer<typeof GetProjectSchema>;
/**
* Schema for archiving a project
*/
export const ArchiveProjectSchema = z.object({
projectId: z.string().describe('Project ID to archive (required)'),
});
export type ArchiveProjectInput = z.infer<typeof ArchiveProjectSchema>;
/**
* Schema for unarchiving a project
*/
export const UnarchiveProjectSchema = z.object({
projectId: z.string().describe('Project ID to unarchive (required)'),
});
export type UnarchiveProjectInput = z.infer<typeof UnarchiveProjectSchema>;
/**
* Schema for listing custom views
*/
export const ListCustomViewsSchema = z.object({
includeArchived: z.boolean().default(false).describe('Include archived custom views'),
});
export type ListCustomViewsInput = z.infer<typeof ListCustomViewsSchema>;
/**
* Schema for creating a custom view
*/
export const CreateCustomViewSchema = z.object({
name: z.string().min(1).describe('Custom view name (required)'),
description: z.string().optional().describe('Custom view description'),
teamId: z.string().optional().describe('Team ID to associate the view with'),
projectId: z.string().optional().describe('Project ID to associate the view with'),
icon: z.string().optional().describe('View icon (emoji or icon name)'),
color: z.string().optional().describe('View icon color in hex format (e.g., "#FF0000")'),
shared: z
.boolean()
.optional()
.describe('Whether the view is shared with everyone in the organization'),
filters: z.record(z.unknown()).optional().describe('JSON object containing issue filters'),
});
export type CreateCustomViewInput = z.infer<typeof CreateCustomViewSchema>;
/**
* Schema for updating a custom view
*/
export const UpdateCustomViewSchema = z.object({
viewId: z.string().describe('Custom view ID (required)'),
name: z.string().optional().describe('New view name'),
description: z.string().optional().describe('New view description'),
teamId: z.string().optional().describe('New team ID'),
projectId: z.string().optional().describe('New project ID'),
icon: z.string().optional().describe('New view icon'),
color: z.string().optional().describe('New view icon color'),
shared: z.boolean().optional().describe('Whether the view is shared'),
filters: z.record(z.unknown()).optional().describe('New JSON object containing issue filters'),
});
export type UpdateCustomViewInput = z.infer<typeof UpdateCustomViewSchema>;
/**
* Schema for getting a custom view
*/
export const GetCustomViewSchema = z.object({
viewId: z.string().describe('Custom view ID (required)'),
});
export type GetCustomViewInput = z.infer<typeof GetCustomViewSchema>;
/**
* Schema for deleting a custom view
*/
export const DeleteCustomViewSchema = z.object({
viewId: z.string().describe('Custom view ID to delete (required)'),
});
export type DeleteCustomViewInput = z.infer<typeof DeleteCustomViewSchema>;