delete_issue
Remove work items from CODING DevOps projects by specifying the issue code and project name using the delete_issue tool on the MCP server.
Instructions
删除工作项
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issueCode | Yes | 事项编号 | |
| projectName | Yes | 项目名称 |
Implementation Reference
- src/tools/issue/delete.ts:5-32 (handler)Core handler function for the 'delete_issue' tool. Validates input parameters, initializes the CodingConnection, calls the API to delete the issue, and returns a formatted MCP response with success message.export async function deleteIssue(args: { projectName: string; issueCode: number; }, config: CodingDevOpsConfig) { if (!args.projectName) { throw new McpError(ErrorCode.InvalidParams, 'projectName02 is required'); } if (!args.issueCode) { throw new McpError(ErrorCode.InvalidParams, 'Issue code is required'); } CodingConnection.initialize(config); const connection = CodingConnection.getInstance(); await connection.deleteIssue({ projectName: args.projectName, issueCode: args.issueCode }); return { content: [ { type: 'text', text: `Successfully deleted issue ${args.issueCode} in project ${args.projectName}`, }, ], }; }
- src/tools/issue/index.ts:66-83 (schema)Schema definition for the 'delete_issue' tool, specifying input parameters projectName (string) and issueCode (number) as required.{ name: 'delete_issue', description: '删除工作项', inputSchema: { type: 'object', properties: { projectName: { type: 'string', description: '项目名称', }, issueCode: { type: 'number', description: '事项编号', } }, required: ['projectName', 'issueCode'], } },
- src/index.ts:124-126 (registration)Registration of the 'delete_issue' tool handler in the main MCP CallToolRequest switch statement, routing calls to tools.issue.deleteIssue.case 'delete_issue': result = await tools.issue.deleteIssue(request.params.arguments); break;
- src/api/coding_connection.ts:324-345 (helper)Helper method in CodingConnection class that sends the HTTP POST request to the CODING DevOps API to delete the specified issue.public async deleteIssue(params: { projectName: string; issueCode: number; }): Promise<void> { const requestBody = { Action: 'DeleteIssue', ProjectName: params.projectName, IssueCode: params.issueCode }; await axios.post( CodingConnection.config.apiUrl, requestBody, { headers: { 'Authorization': `token ${CodingConnection.config.token}`, 'Content-Type': 'application/json', 'Accept': 'application/json' } } ); }
- src/index.ts:61-65 (registration)Initialization of tool instances, including issueTools which provides the deleteIssue handler and its schema definitions.const toolInstances = { issue: issueTools.initialize(this.config), project: projectTools.initialize(this.config), code: codeTools.initialize(this.config), };