list_issues
Retrieve recently updated work items by issue type, such as defects, requirements, tasks, epics, or all. Default query returns up to 20 items per project.
Instructions
查询我最近更新的工作项,可以根据其中IssueType查询,默认查询limit为20条
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueType | No | 事项类型,可选值为: ALL - 全部事项 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 | |
| limit | No | 事项数量,默认为20条 | |
| projectName | Yes | 项目名称 |
Implementation Reference
- src/tools/issue/list.ts:6-32 (handler)Main handler function that implements the core logic for listing issues: validates input, initializes connection, calls API, and returns formatted JSON response.
export async function listIssues(args: { projectName: string; issueType?: string; limit?: string; }, config: CodingDevOpsConfig) { if (!args.projectName) { throw new McpError(ErrorCode.InvalidParams, 'projectName03 is required'); } CodingConnection.initialize(config); const connection = CodingConnection.getInstance(); const issues = await connection.listIssues({ projectName: args.projectName, issueType: args.issueType, limit: args.limit }); return { content: [ { type: 'text', text: JSON.stringify(issues, null, 2), }, ], }; } - src/tools/issue/index.ts:10-30 (schema)Input schema and metadata definition for the 'list_issues' tool, used for validation and listing available tools.
{ name: 'list_issues', description: '查询我最近更新的工作项,可以根据其中IssueType查询,默认查询limit为20条', inputSchema: { type: 'object', properties: { projectName: { type: 'string', description: '项目名称,注意是项目的 name 不是 displayName,建议先通过 list_projects 查看项目名称', }, issueType: { type: 'string', description: '事项类型,可选值为: ALL - 全部事项 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗', }, limit: { type: 'string', description: '事项数量,默认为20条', } }, required: ['projectName'], } - src/index.ts:118-119 (registration)MCP server switch case that registers and dispatches calls to the 'list_issues' tool handler.
case 'list_issues': result = await tools.issue.listIssues(request.params.arguments); - src/tools/issue/index.ts:146-150 (handler)Wrapper handler in issueTools.initialize that passes config to the core listIssues function.
listIssues: (args: { projectName: string; issueType?: string; limit?: string; }) => listIssues(args, config), - src/api/coding_connection.ts:266-297 (helper)Supporting method in CodingConnection that makes the actual API request to list issues.
public async listIssues(params: { projectName: string; issueType?: string; limit?: string; offset?: string; sortKey?: string; sortValue?: string; }): Promise<CodingIssue[]> { const requestBody = { Action: 'DescribeIssueList', ProjectName: params.projectName, IssueType: params.issueType || 'ALL', Limit: params.limit || '20', Offset: params.offset || '0', SortKey: params.sortKey || 'UPDATED_AT', SortValue: params.sortValue || 'DESC' }; const response = await axios.post<CodingIssuesResponse>( CodingConnection.config.apiUrl, requestBody, { headers: { 'Authorization': `token ${CodingConnection.config.token}`, 'Content-Type': 'application/json', 'Accept': 'application/json' } } ); return response.data.Response.IssueList; }